Difference between public class s{ } and class s{ } in java?
Answers
Answered by
0
Simply, the public class only represents that the methods and variables of the class are accessible to other classes. However, in some applications such as BlueJ, classes are automatically public, and declaring public is not necessary.
rajiv1144:
If that is private class s{ } then?
Answered by
0
There is no difference as class is declared as public by default.... Using public class s{} shows that they are public....
Similar questions