What is the need to declare main() method as static in Java?

Answer Posted / shadab alam

static keyword specifies that there is no need of instance
to call static method and it's information is contained by
JVM that calls the static method.That's why we declare main
method as static so that it can be called automaticlly.

Is This Answer Correct ?    58 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What if the main method is declared as private?

649


Which interceptor is responsible for setting action javabean properties?

649


What kind of thread is the garbage collector thread?

723


What is stateless class in java?

742


What is a stream in java?

736


What is jsr in java?

700


How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))

1535


What is ehcache in java?

724


How common are security breaches? : java security

715


How should I format my code? How should I comment my code?

724


What do you understand by casting in java language? What are the types of casting?

655


What is jboss in java?

696


Can you compile java into exe?

814


What is class path in java?

669


there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.

3664