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
Why Java doesn’t support multiple inheritance?
what is comparable and comparator interface?
What is enhanced loop in java?
Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?
How is a variable stored in memory?
What do you mean by exception handling in Java?
What is use of super keyword in java?
What is 32 bit float?
How to store image in arraylist in java?
What is meant by 'bit masking' in java?
What is main in java?
What are default methods ?
Is it possible to specify multiple jndi names when deploying an ejb?
What are class types in java?
What is difference between string and new string?