I have a question that why main method is marked as public?
According to an answer on stackoverflow, It is declared as static
Public - main method is called by JVM to run the method which is outside the scope of project therefore the access specifier has to be public to permit call from anywhere outside the application.
Public
From coderanch