-
What is the output of this program?
class box_Shape
{
int w;
int h;
int l;
int vol;
void vol()
{
vol = w * h * l;
}
void vol(int p)
{
vol = p;
}
}
public class Result
{
public static void main(String args[])
{
box_Shape bs = new box_Shape();
bs.h = 2;
bs.l = 7;
bs.w = 6;
bs.vol(6);
System.out.println(bs.vol);
}
}
-
- 50
- 5
- 60
- 6
- 16
Correct Option: D
Output: 6