Java Interview Questions & Answers part 2

0
495
Q: – Can you write a Java class that could be used both as an applet as well as an application?

Yes, Add a main() method to the applet.

Q: – What is IncludeAction?

The IncludeAction class is useful when you want to integrate Struts into an application that uses Servlets.

Q: – What is SwitchAction?

The SwitchAction class provides a means to switch from a resource in one module to another resource in a different module. SwitchAction is useful only if you have multiple modules in your Struts application.

Q: – What is role of Action Class?

An Action Class performs a role of an adapter between the contents of an incoming HTTP request and the corresponding business logic that should be executed to process this request.

Q: – Can we have more than one struts-config.xml file for a single Struts application?

Yes

Q: – What's the difference between J2SDK 1.5 and J2SDK 5.0?

There's no difference, Sun Microsystems just re-branded this version.

Q: – How to display validation errors on jsp page?

<html:errors/> tag displays all the errors. <html:errors/> iterates over ActionErrors request attribute.

Q: – What are the different kinds of actions in Struts?

ForwardAction
IncludeAction
DispatchAction
LookupDispatchAction
SwitchAction

Q: – You are planning to do an indexed search in a list of objects. Which of the two Java collections should you use: ArrayList or LinkedList?

ArrayList

Submitted By:-Ankur Jain           Email-ID: – ankurjain548@gmail.com

SHARE

LEAVE A REPLY