What is the use of static keyword in "public static void
main()"

Answer Posted / rozer willis

static keyword makes the main function static.And the
advantage to make it static is that it can call other
static methods of the sane class just by their names i.e.no
need to create object.And the static method cant be
override so it prevent the main method from onerriding.

Is This Answer Correct ?    34 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the similarity between dynamic binding and linking?

622


Is arraylist sorted in java?

539


explain copyonwritearraylist and when do we use copyonwritearraylist?

554


What is Classloader in Java?

642


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

1991






What does arrays sort do in java?

551


What is the properties class?

567


If two threads have same priority which thread will be executed first ?

852


How big is a boolean?

590


How does queue work in java?

532


what is comparable and comparator interface?

584


What is the benefit of using enum to declare a constant?

671


Is 0 true or is 1 true?

522


What is the difference between integer parseint and integer valueof?

559


What does the “static” keyword mean?

591