What is the need to declare main() method as static in Java?
Answer Posted / monalisa
public static void main(String[] args) means
public - is the access modifier .if we declare a method as
public means we can access the method out side of the class.
static - It is a key word.If we declare a method as static
then we can call this method with out creating any instance
of that class.Directly we can call it by "CLASSNAME.STATIC
METHOD NAME"
void - It is the return type of the method
main - It is the Method name
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
What are the new features about Java se 8 ?
What is hql in java?
What is aop in java?
What is an entity in java?
Is it correct to say that using parentheses can only change?
What is the use of flatmap in java 8?
What is java flatmap?
What is spliterator in java se 8?
What is the difference between swing and awt components?
What is ibatis in java?
i have client interview in TCS.client is CITI BANK.how to face it,what type of questions they will ask,please tell send me to kumar525job@gmail.com
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.
What is entitymanager in jpa?
What type of parameter passing does java support?
How do you type the lambda symbol?