(摘自stackoverflow)
“The public type <<classname>> must be defined in its own file” error in Eclipse [duplicate]
8
3
|
This question already has an answer here: I have written the following code:
I am getting the error message:
error in the very first line EDIT- After making just one class public or both the classes default, I am getting the error "Selection does not contain a main type". Now what should I do? |
||||||||||||||||||||
marked as duplicate by Holger, Dennis Meng, Raedwald, David L, Jarrod Roberson Nov 6 '13 at 22:32This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. |
|||||||||||||||||||||
|
15
|
We cant have two public classes in one file. The JVM cannot understand, in one file we must write one public class only.
|