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 is a numeric digit?
What is formatted output?
What is anagram of a string?
What does a boolean method return?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
What does int [] mean in java?
What is unicode used for?
How do you sing an Applet ?
What is difference between wait and notify in java?
What does .equals do in java?
Why spring singleton is not thread safe?
Can list be null in java?
Which is best ide for java?
Explain 5 io best practices?
Can we cast any other type to boolean type with type casting?