Recently I had been to a interview some questions are : Can u any one answer these?
a. Which is true? 1 An inner class cannot extend Super Class 2 An inner class cannot implement interface 3 An inner Class can extend a Super Class and interface 4 An ic can implement SC and interface
b. When invoking loadClass() of a class , if parent Class loader of class under consideration returns null then a) Class not found exception b) Null pointer exception c)class loading in builtin JVM is used d) Nothing happens, pgm continues
c. Version setting of cookie is by: cookieobj.setVersion(Cookie c , int v); responseobj.setCookie(Cookie c , int v); responseobj.addCookie(Cookie c , int v); none
d. Transaction is rolledback if system Exception is thrown : True/false.
e. Transaction is rolledback if application Exception is thrown : True/false.
f. Native modifier: can be applied to class, to method, class variable, instance variable which is valid?
g. What is meant by native modifier?
h. Which is transaction attribute for MsgDrivenBean? NotSupported,REquired, Mandatory
i. Public class TestServlet extend HttpServlet implements SingleThreadedModel { private static int num=5; public doGet(HttpServletRequest req, HttpServletRes res) {} } Which is thread safe? num and req, num and req both not, num alone, req alone. all
j. Which is slowest access to an elt in middle of alist by means of index? Array, Vector,ArrayList, LinkedList, All, none.
k. Write a Java program in which a Thread A reads from a file F1 and thread B writes the contents into the File F2.