Home » JAVA Programming » Modifier Types » Question
  1. What is the output of this program?

    class box_area
    {
    int w;
    int l;
    int h;
    box_area()
    {
    w = 7;
    l = 4;
    h = 2;
    }
    void volume()
    {
    int vol = w * h * l;
    System.out.println(vol);
    }
    }
    public class cons_method
    {
    public static void main(String args[])
    {
    box_area obj = new box_area();
    obj.volume();
    }
    }
    1. 36
    2. 46
    3. 54
    4. 56
    5. 66
Correct Option: D

Output: 56



Your comments will be displayed only after manual approval.