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 is native class in java?
Can we install jre without jdk?
Why is struts used in java?
What is factory pattern in java?
What are jpa annotations?
what is reflection api? How are they implemented?
What is stateful in java?
Explain the encapsulation principle.
What is java lang noclassdeffounderror?
Write a program for the problem: the array of inetegers indicating the marks of the students is given, U have to calculate the percentile of the students aaccording to this rule: the percentile of a student is the %of no of student having marks less then him. For eg: suppose Student Marks A 12 B 60 C 80 D 71 E 30 F 45 percentile of C = 5/5 *100 = 100 (out of 5 students 5 are having marks less then him) percentile of B = 3/5*100 = 60% (out of 5, 3 have markses less then him) percentile of A = 0/5*100 = 0%.
What is stateless class in java?
What is microservices java?
In hibernate what is the difference between the Session and SessionFactory?
What is javabeans api?
How do I run a java project in netbeans?