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 type of variable is error flag?
What is the use of jtable?
Is namespace same as package in java?
What is the use of runnable interface?
Can a variable be local and static at the same time?
What is the core java?
What is the difference between synchronized and synchronized block?
What is the public field modifier?
In multi-threading how can we ensure that a resource isn't used by multiple threads simultaneously?
Can a class have more than one object?
What does exclamation mean in java?
What are the library functions in java?
Explain about java sdk?
What is the transient keyword?
Is java same as core java?