Inspite of writing the name of the file as the name of public class I am getting compilation error . Please help me.
For Java in codechef online judge have two options
You can submit a java program with class name as given below :
- public class Main{
public static void main (String[] args) throws java.lang.Exception {
// your code here
}
}
- class YourClassName{
public static void main (String[] args) throws java.lang.Exception {
// your code here
}
}
Remember " the name of a public class has to be "Main "
If you use some other class do not declare it public. Also do not use any packages.
For more information check codechef sample for java here.
Hope this helps.