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 jagged array in java?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
How do you create a first line indent?
List the features of java programming language.
Is ++ operator is thread safe in java?
What is java util function?
How do you define a method?
What is annotation in java?
What is this () in java?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
What is a singleton in genetics?
Which container method is used to cause a container to be laid out and redisplayed in java programming?
Write a java program that prints all the values given at command-line.
What is Mutex (Mutual Exclusion Object) ?
What is an immutable class?