20
(Choose 1 answer)
D. Compiler error
}
}
}
class Box
What will be the output of the following Java program?
{
int width;
int height;
int length;
int volume;
public Box(int width, int height, int length){}
void volume(int height, int length, int width)
{
volume = width*height*length;}
A. 25
B. 12
C. 60
class Using
{
public static void main(String args[])
Box obj = new Box(3,4,5);
obj.height = 1;obj.length = 5;
obj.width = 5;
obj.volume(2,2,3);
System.out.println(obj.volume);