Can the main() method be specified as private or protected?
Will it compile?
Will it run?
Yes, It will compile but Not Run. It will give you the following errors
Error: Main method not found in class A, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend javafx.application.Application
Following are the simple code for testing
class A {
private static void main(String arg[])
{
System.out.print(2+3);
}
}