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
What if the main method is declared as private?
Which interceptor is responsible for setting action javabean properties?
What kind of thread is the garbage collector thread?
What is stateless class in java?
What is a stream in java?
What is jsr in java?
How to reverse the singly linked list(In Node data members are(int data,int pointerTONext))
What is ehcache in java?
How common are security breaches? : java security
How should I format my code? How should I comment my code?
What do you understand by casting in java language? What are the types of casting?
What is jboss in java?
Can you compile java into exe?
What is class path in java?
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.