ExamVeda
Login
Home
Constructors and Methods
?

What will be the output of the following Java code?
class box 
{
    int width;
    int height;
    int length;
    int volume;
    box() 
    {
        width = 5;
        height = 5;
        length = 6;
    }
    void volume() 
    {
         volume = width*height*length;
    } 
}    
class constructor_output 
{
    public static void main(String args[])
    {
        box obj = new box();
        obj.volume();
        System.out.println(obj.volume);
    }
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.