0
My First Java Code Help
import java.util.*; /*Please dont change class name, Dcoder and class must not be public*/ //Compiler version JDK 1.8 class Dcoder { public static void main(String args[]) { System.out.println("Hello, Dcoder!"); } } public class Maths{ public static void main(String args[]) { int sum1 = 20 int sum2 = 40 int sum3 = sum1 + sum2 + 10 System.out.println(sum3); } } Please help why it is not compiling in any compiler pls fast and easy answer.
6 odpowiedzi
+ 2
I think the problem is because of your double main method.... you can only have one per program.
Try to change the name of the first main.
Tell me if it fixed it.
+ 2
it's Missing ;
int sum1 = 20;
int sum2 = 40;
int sum3 = sum1 + sum2;
At the end of every sentence there must be a ;
Greetings
+ 1
You have put 2 classes.
Remove the statement 'public class Maths' and arrange the brackets that way.
0
thanks for help.
0
not fixed Problem In Public Class Maths what is this?
when I removed Pulic there is no error but it only prints Hello Coder in Output. please help.
0
Vhjjbxndiojfr you ht