Wednesday, February 17, 2010

Best java Interview Questions faced by me:

How to get classpath from java code?
Ans : System.getProperty(“java.class.path”);

2) How to write methods in JSP code?
Ans : We can write jsp methods in tag. This part of the code is compiled and inserted outside the _jspservice() method in the generated servlet class.

3) If your design changes frequently, what would you prefer to use: interfaces or abstract classes?

4) If an object of a class is being used as the key of a Map, what methods should it compulsorily implement?
Ans : It should implement the equals and hashcode method

5) What is a String Pool?

6) How to increase the memory of JVM? Not specific to tomcat apache. Specific to java.

7) How to know if an object is an object of a serializable class?

8) How does driver manager get loaded?

9) Can a static method be overridden?

10) Can we override service() method in jsp?
Ans: No, we can not.

There is more to come ...


  1. Sounds good..... please share more.

  2. Where are the rest of the answers?