0
Multiple public classes in java?
I think only one top-level public class is accepted per file. But in sololearn there are no errors when we execute code with 2 public classes and program runs fine. How. https://code.sololearn.com/cY9gt1b7vm2I/?ref=app
2 Answers
+ 1
Sololearn is not 100% java compatible because it execute your code on remote server and code is prepare and modify before it by machine. but it is still acceptable.
if you only have one file, it is useful if there can be two public classes together.
- 2
In sololearn only program as the class name is accepted.