0% found this document useful (0 votes)
9 views2 pages

Data Analysis and Processing Guide

The document contains a series of questions and answers related to Java programming concepts, including Exception handling, Serializable interface, String equality, Static methods, Abstract classes, Struts framework, and Singleton classes. Key points include that Throwable is the superclass of all exceptions, the hashCode method returns an int, and the ActionServlet class acts as the controller in Struts 1.x. Additionally, it explains the lifecycle methods of Servlets and behavior of HashMap when inserting duplicate keys.

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)
9 views2 pages

Data Analysis and Processing Guide

The document contains a series of questions and answers related to Java programming concepts, including Exception handling, Serializable interface, String equality, Static methods, Abstract classes, Struts framework, and Singleton classes. Key points include that Throwable is the superclass of all exceptions, the hashCode method returns an int, and the ActionServlet class acts as the controller in Struts 1.x. Additionally, it explains the lifecycle methods of Servlets and behavior of HashMap when inserting duplicate keys.

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

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 [Link] 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