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
How is string immutable in java?
What are the special characters?
What is java abstraction with example?
What is difference between iterator and enumeration in java?
What is java literals?
How can you traverse a linked list in java?
Can we able to pass objects as an arguments in java?
what is meant by encapsulation?
Write a java program to generate fibonacci series ?
What is a consumer in java?
What is the main functionality of the remote reference layer?
What is the purpose of void class?
What is the best definition for data?
What is the difference between error and an exception?
Explain about the dynamic behavior of core java?