0
ERROR
public class Test { public static void main(String []args) { box b1 = new box(); b1.setDimension(12,5,2); b1.showDimension(); } } public class box { int length,breadth,height,l,b,h; public void setDimension(int l,int b,int h); { length=l; breadth=b; height=h; } public void showDimension() { System.out.println("Length = "+length); System.out.println("Breadth = "+breadth); System.out.println("Height = "+height); } } PLEASE HELP ME TO FIND OUT IT'S ERROR.... I DON'T GET IT'S OUTPUT
3 ответов
+ 3
public class Test
{
public static void main(String []args)
{
box b1 = new box();
b1.setDimension(12,5,2);
b1.showDimension();
}
}
public class box
{
int length,breadth,height,l,b,h;
public void setDimension(int l,int b,int h)
{
length=l;
breadth=b;
height=h;
}
public void showDimension()
{
System.out.println("Length = "+length);
System.out.println("Breadth = "+breadth);
System.out.println("Height = "+height);
}
}
https://code.sololearn.com/cqjFWaU8GFI4/?ref=app
+ 4
hello
you should delete ; at the end of the setDimention
+ 1
I suggest that you turn it into code first, so people are willing to look at it.