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 the basic difference between string and stringbuffer object?
Can we use string in the switch case?
Why multiple inheritance is not supported by java?
Can we declare the main method of our class as private?
Explain java coding standards for constants?
What is the byte order of byte buffer?
What is update method called?
What does jre stand for?
How destructors are defined in java?
What is the maximum size of list in java?
Garbage collection in java?
What are the main uses of java?
Is heap stored in ram?
What is the difference between interface & abstract class?
What is the hashcode () and equals () used for?