Home » JAVA Programming » Object & Classes » Question
  1. What is the output of this program?

    class box_Shape
    {
    int width;
    int height;
    int length;
    }
    public class mainclass
    {
    public static void main(String args[])
    {
    box_Shape obj = new box_Shape();
    obj.width = 12;
    obj.height = 4;
    obj.length = 15;
    int p = obj.width * obj.height * obj.length;
    System.out.print(p);
    }
    }

    1. 420
    2. 520
    3. 620
    4. 720
    5. 820
Correct Option: D

output: 720



Your comments will be displayed only after manual approval.