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
Which of the following is not an isolation level in the JDBC
What are the different ways of creating thread?
What are the steps involved to write rmi based programs?
what are the high-level thread states? : Java thread
What is widening and narrowing in java? Discuss with an example.
How many types of voids are there?
Which list is sorted in java?
What is unsigned char?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
Can a static class have a constructor?
Is list thread safe in java?
What is a method in programming?
What is a ternary operator in java?
What is default constructors?
What sorting algorithm does javascript use?