// main class
class prac_1_3{
public static void main(String[] args){
System.out.println("Practical 3");
}
}
I have seen it on many websites and heard that the main class should be a public modifier.
So, to confirm that I ran this above code without a public modifier and it ran successfully.
I want to know about this from you. please explain me that, in which situation a public modifier is required in terms of only main class ( i know the basics about public modifiers but I am confused with the main class file).
with public keyword and without public keyword it executed successfully.