Core Java Interview questions


Total available count: 646
Subject - Java Technologies
Subsubject - Core Java

Why main method is static in java?

Because object is not required to call static method if It were non-static method, jvm creates object first then call main() method that will lead to the problem of extra memory allocation.

 




Next 5 interview question(s)

1

What do you know about static method in java?

2

What is the difference between Abstraction and Encapsulation in java?

3

What is  immutable class and give an example?

4

Can we use final for constructor?

5

 Which keyword helps to prevent overriden and inherit in java?