ERROR | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

9th Jun 2020, 12:22 PM
jenny
3 Answers
+ 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
9th Jun 2020, 12:33 PM
hamid
hamid - avatar
+ 4
hello you should delete ; at the end of the setDimention
9th Jun 2020, 12:31 PM
hamid
hamid - avatar
+ 1
I suggest that you turn it into code first, so people are willing to look at it.
9th Jun 2020, 12:32 PM
CapCode