+ 1

what's wrong in the codes. I would appreciate any help

public class Program { public static void eh(int x) { System.out.println("x is "+x) ; } } public static void main(String[]args) { eh(57) ; eh(); }

4th Feb 2017, 6:23 AM
shobhit
shobhit - avatar
1 ответ
+ 6
you are closing the class too early. include main into the class. also you can't call eh without arguments. your code should look like this: public class Program { public static void eh(int x) { System.out.println("x is "+x) ; } public static void main(String[] args) { eh(57) ; eh(0); } }
4th Feb 2017, 7:07 AM
Mario L.
Mario L. - avatar