1195 - Basically Speaking
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Re: 1195 - Basically Speaking
I send:
And I got Runtime Error
Whats wrong???
Im asking because I send my solution and I always get RE
Code: Select all
class Main {
public static void main(String[] args) {
System.out.println("ss");
}
}Whats wrong???
Im asking because I send my solution and I always get RE
-
humbertodiaz
- Posts: 97
- Joined: 6 years ago
- Gender:

Re: 1195 - Basically Speaking
Interesting... Your code is virtually the same as the sample Java program provided on the FAQ. I tried it out and confirmed that it gives an RTE. Then I made the class public and it worked. So it seems the sample program is wrong. o_o The error is probably that Java can't find the main() method when the program is executed. Sometimes people have this problem when starting out with online judges and it's terribly confusing.
To be clear, I simply added "public" before "class Main" and got it to work. Also, you don't have to name the class Main. I've been submitting classes with other names and it works fine. Avoid using packages since those would probably cause an RTE.
I'll poke one of the admins to get the example fixed, too...
To be clear, I simply added "public" before "class Main" and got it to work. Also, you don't have to name the class Main. I've been submitting classes with other names and it works fine. Avoid using packages since those would probably cause an RTE.
I'll poke one of the admins to get the example fixed, too...
Re: 1195 - Basically Speaking
Thank you humbertodiaz!
You are right, you have to make the class public and as you said you can name the class whatever you want.
Have a nice week!
You are right, you have to make the class public and as you said you can name the class whatever you want.
Have a nice week!
