+ 1
public class in java
I know that we can't run a java program without a public class still why we can run a program without public class in sololearn compiler?
3 Respuestas
+ 1
We can run a java program without public class. If we want to we can have atmost one public class in our source code. In that case name of the program must be same as name of the public class.
0
It is software and public keywords is predefined in sololearn
0
We declare public class for accessing means any one can access so thats why we declare public class