0% found this document useful (0 votes)
24 views

Preliminary Java Questions

The Serializable interface is just a "marker" interface, with no methods of its own to implement. The class org.apache.struts.action.ActionServlet in the Struts Framework plays the role of controller. If a hash map has a key with a given value and user adds the same key but different value, what will be the output if one tries to fetch value using that key?

Uploaded by

hereisbharat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Preliminary Java Questions

The Serializable interface is just a "marker" interface, with no methods of its own to implement. The class org.apache.struts.action.ActionServlet in the Struts Framework plays the role of controller. If a hash map has a key with a given value and user adds the same key but different value, what will be the output if one tries to fetch value using that key?

Uploaded by

hereisbharat
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Which is super most class for all Exception classes? Ans. Throwable 2.

How many methods do you implement if a class implements the Serializable interface? Ans. 0 Explanation: The Serializable interface is just a "marker" interface, with no methods of its own to implement. 3. If two String objects are equal according to the equals method, does calling the hashCode method on each of the String objects will produce the same result ? A. True B. False Ans. A If above question answered correctly then What is the return type of hashCode() method ? Ans. Int 4. Can Static Methods be overridden ? A. True B. False Ans. B 5. Can Abstract Class be Instantiated? A. True B. False Ans. B 6. Can Abstract class be Final? A. True B. False Ans. B 7. Which class plays the role of controller in Struts 1.x ? Ans. ActionServlet Explanation: The class org.apache.struts.action.ActionServlet in the Struts Framework plays the role of controller. All the requests to the server go through the controller. Controller is responsible for handling all the requests. 8. What is value stack? It is a temporary storage area where framework keeps the data for particular request 9. How to configure your own interceptor in struts 2.0? Create the interceptor and write the reference in the interceptor stack in struts xml 10. What is Singleton class? Ans. Singleton class is a class in which at a time only one object can create. 11. What are the Lifecycle Methods of Servlet?

Ans: init, service, destroy 12. If a hash map has a key with a given value and user adds the same key but with different value, what will be the output if one tries to fetch value using that key? A. Not Allowed B. Latest Inserted value C. Previous value D. Compilation Fails Ans. B

You might also like