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

    class box_Shape
    {
    int width;
    int height;
    int length;
    int volume;
    void volume(int heigth, int lenght, int width)
    {
    volume = width*height*length;
    }
    }
    public class Prameterized_method_Example
    {
    public static void main(String args[])
    {
    box_Shape obj = new box_Shape();
    obj.height = 5;
    obj.length = 6;
    obj.width = 10;
    obj.volume(5,6,10);
    System.out.println(obj.volume);
    }
    }

    1. 100
    2. 200
    3. 300
    4. 400
    5. 500
Correct Option: C

Output: 300



Your comments will be displayed only after manual approval.