ExamVeda
Login
Home
Constructors and Methods
?

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

Answer & Solution
Correct Answer: Option D
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.