javascript
Brief description  about Online courses   join in Online courses
View Shristy  Bhati 's Profile

doublt regarding a statement

Can anyone plz tell me the word to word significance of the below statement we usually use in our program:
" public static void main(String[]args) "
Asked by Shristy Bhati | Apr 14, 2013 |  Reply now
Replies (1)
View Luvita Burgess 's Profile
Hi,
Public is access specifier means visible to all.
"Static" means the method can be accessed using class and not object(instant) of the class i.e. is shared by all objects. Another use is, usually static variables can be accessed using static method. So, if you want to use static variable in main, the main method should be static. Static variable has the same meaning - accessed using class.
Void means "no return type". main is function name.
String args[] is array of parameters of type String.
I see java throws a run time error if we don't folow the above format..
Apr 20, 2013