What will be the output of the following Java program?

class box 
{
    int width;
    int height;
    int length;
} 
class mainclass 
{
    public static void main(String args[]) 
    {        
         box obj = new box();
         obj.width = 10;
         obj.height = 2;
         obj.length = 10;
         int y = obj.width * obj.height * obj.length; 
         System.out.print(y);
    } 
}

a) 12
b) 200
c) 400
d) 100

1 thought on “What will be the output of the following Java program?”

Leave a Comment