-
What is the output of this program?
class box_area
{
int w;
int l;
int h;
box_area()
{
w = 7;
l = 4;
h = 2;
}
void volume()
{
int vol = w * h * l;
System.out.println(vol);
}
}
public class cons_method
{
public static void main(String args[])
{
box_area obj = new box_area();
obj.volume();
}
}
-
- 36
- 46
- 54
- 56
- 66
Correct Option: D
Output: 56