Java Interview Questions & Answers part 3

Q: – Why would you use a synchronized block vs. synchronized method?

Synchronized blocks place locks for shorter periods than synchronized methods.

Q: – What is the ActionForm?

ActionForm is javabean which represents the form inputs containing the request parameters from the View referencing the Action bean.

Q: – What are the important methods of ActionForm?


Q: – What is MVC?

Model-View-Controller (MVC) is a design pattern put together to help control change.

Q: – What is a framework?

A framework is made up of the set of classes which allow us to use a library in a best possible way for a specific requirement.

Q: – Explain the usage of the keyword transient?

This keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).

Q: – What are the components of Struts?


Q: – What is ActionMapping?

Action mapping contains all the deployment information for a particular Action bean. This class is to determine where the results of the Action will be sent once its processing is complete.

Q: – How can you force garbage collection?

You can't force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.

Submitted By:-Ankur Jain           Email-ID: –