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

    class box_Shape
    {
    int w;
    int h;
    int l;
    int vol;
    void vol(int h, int l, int w)
    {
    vol = w * h * l;
    }
    }
    public class Prameterized_method_Example
    {
    public static void main(String args[])
    {
    box_Shape obj = new box_Shape();
    obj.h = 6;
    obj.l = 3;
    obj.w = 4;
    obj.vol(6, 3, 4);
    System.out.println(obj.vol);
    }
    }
    1. 68
    2. 70
    3. 72
    4. 74
    5. 76
Correct Option: C

Output: 72



Your comments will be displayed only after manual approval.