Top 10 JAVA Interview Questions

1) Can we declare a class as Abstract without having any abstract method?
2) What are the performance implications of Interfaces over abstract classes?
3) Does Importing a package imports its sub-packages as well in Java?
4) When a lot of changes are required in data, which one should be a preference to be used? String or StringBuffer?
5) A person says that he compiled a java class successfully without even having a main method in it? Is it possible?
6) Can we call a non-static method from inside a static method?
7) Can a dead thread be started again?
8) Can we use goto in Java to go to a particular line?
9) Is it possible to define a method in Java class but provide it’s implementation in the code of another language like C?
10) Can we have any other return type than void for main method?

Leave a Reply

Your email address will not be published. Required fields are marked *