-
What is the output of this program?
class box_Shape
{
int width;
int length;
int height;
int volume;
box_Shape()
{
width=8;
length=3;
height=5;
}
void volume()
{
volume = width*length*height;
}
}
public class cons_method_Example
{
public static void main(String args[])
{
box_Shape obj = new box_Shape();
obj.volume();
System.out.println(obj.volume);
}
}
-
- 100
- 110
- 120
- 130
- 140
Correct Option: C
output: 120