Why does sometimes the class have public beforehand? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why does sometimes the class have public beforehand?

something like this public class myClass { public static void main(String[] args) { system.out.println("Hello World"); } }

28th Aug 2018, 5:34 PM
Miguel Guerrero
Miguel Guerrero - avatar
1 Answer
+ 9
Class is accessible for classes, interfaces in separate packages. ๐Ÿค—๐Ÿ™†โ€โ™‚๏ธ๐Ÿ’–
28th Aug 2018, 5:47 PM
NimWing Yuan
NimWing Yuan - avatar