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

Answer Posted / s. devanand

In Java, we call any method and variable without creating an
object of the class. Hence we declare main method as static
without creating an object we call the main method.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a container in java?

540


What are the Advantages of java se 8 new features?

611


Are jvm’s platform independent?

564


What is maven in java?

536


What is lambda used for?

545






What is gwt in java?

572


What is stateless in java?

571


Can I use openjdk for commercial?

582


Describe life cycle of thread?

650


What is transactional in java?

610


Why dependency injection is used in java?

573


What is adoptopenjdk?

582


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.

2716


What is predicate in lambda expression?

539


What are jdk tools?

574