Saturday, February 21, 2009

Tricky Questions

1)Can I get Session object from servlet or jsp to simple java class?
2)What is a singleton class?
3)What is the difference between sendRedirect and forward in servlet ?
4)What happened if i clone a singleton object?
5)What is the difference between PrintWriter and JspWriter class?
6)Can I call a static variable with object?
7)What are the collection framework hibernate supports?
8)How to get variable value from javascript in to jsp page?
9)What is the difference between pageContext and SevletContext?
10)Why java doesnot support multiple inheritance?
11) Can we use a ResultSet object after closing the Connection??
Actually not, but you can use RowSet in connectionless mode
12) By default java will import java.lang
println() is the method of class PrintStream and in the package java.io.*
Why how we are able to use println() without importing java.io.*
we dont use println() directly :P , instead we use System.out.println() where out is a final static member of type PrintStream in System class, and System class imports java.io.* for us so we need not bother to import java.io package.
11) Explain Memory leak in java ?
12) Write a program of Dead Lock condition in java .
13) What is the difference between sleep(1000) and wait(1000) ?
15) What is delegation in Java?

No comments:

Post a Comment