Tuesday, November 29, 2011

Why we have used to in main method in JAVA this words

The "public" keyword is an access specifier,which allows the programmer to control the visibility of class members.:public means common for all classes.:This uses public so that it is visible every where:In main method each word have specific meaning like we declare main method as public so that JVM will able to execute it(i.e. method will accessible outside the class in which it is declared).We declare it as static so that JVM will able to execute it without creating object of that class .we declare void to inform that main method doesn&
Category:Java Interview Questions

No comments:

Post a Comment