What is the use of static keyword in "public static void
main()"
Answer Posted / rasool
The public keyword is an access specifier, which allows the
programmer to control the visibility of class members. When
a class member is preceded by public, then that member may
be accessed by code outside the class in which it is
declared.In this case, main( ) must be declared as public,
since it must be called by code outside of its class when
the program is started. The keyword static allows main( ) to
be called without having to instantiate a particular
instance of the class.
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What do you mean by ordered and sorted in collections in java?
What are voids?
What 5 doubled?
What are the advantages of exception handling?
What is the difference between static binding and dynamic binding?
What are java packages? What's the significance of packages?
What is the difference between post and put?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
What are the concepts of 'OOPS'?
What is scope & storage allocation of global and extern variables? Explain with an example
When is an object subject to garbage collection?
what is synchronization and why is it important? : Java thread
What is the difference between dom and sax parser in java?
Why do you canvas?
What is the function of static in java?