Recently asked Oracle Telephonic Interview Question and Answers

What  Design Patterns are you using in your project?
i)MVC separates roles using different technologies,
ii)Singleton Java class To satisfy the Servlet Specification,a servlet must be a   

single Instance  multiple thread component.
iii)Front Controller A Servlet developed as Front Controller can traps only the requests.
iv) D.T.O/ V.O Data Transfer Object/Value object is there to send huge amount of data from one layer to another layer. It avoids Network Round trips.
v)IOC/Dependency Injection F/w s/w or container can automatically instantiates the objects  implicitly and  injects  the dependent data to that object.
vi)Factory method It won’t allows object instantiation from out-side of the class.
vii)View Helper It is there to develop a JSP without Java code so that readability,re-usability will become easy.

What is Singleton Java class & its importance?
A Java class that allows to create only one object per JVM is called Singleton Java class.
Ex:  In Struts f/w, the ActionServlet is a Singleton Java class.
Use: Instead of creating multiple objects for a Java class having same data, it is recommended to create only one object & use it for multiple no. of times.

What are the differences b/w perform() & execute()?

perform() is an deprecated method.

What are the drawbacks of Struts? Is it MVC-I or II?   
  

Struts is MVC-II
1) Struts 1.x components are API dependent.  Because Action & FormBean classes must extend from the Struts 1.x APIs pre-defined classes.
2)  Since applications are API dependent hence their “Unit testing” becomes complex.
3)  Struts allows only JSP technology in developing View-layer components.
4)  Struts application Debugging is quite complex.
5)  Struts gives no built-in AJAX support. (for asynchronous communication)
Note:In Struts 1.x, the form that comes on the Browser-Window can be displayed under no control of F/W s/w  & Action class.

What are the differences b/w struts, spring and hibernate?
Struts:  allows to develop only webapplications and it can’t support POJO/POJI model programming.
Spring: is useful in developing all types of Java applications and support POJO/POJI model programming.
Hibernate: is used to  develop DB independent persistence logic It also supports POJO/POJI model programming.

What are differences b/w Servlets & Jsp?

Servlets:
 i)It  requires Recompilation and  Reloading when we do modifications in a    Servlet.(some servers)

ii)Every Servlet must be configured in “web.xml”.
iii)It is providing less amount of implicit objects support.
iv)Since it consists both HTML & B.logic hence modification in one logic may disturbs the other logic.
v)No implicit Exception Handling support.
vi)Since it requires strong Java knowledge hence non-java programmers shows no interest.
vii)Keeping HTML code in Servlets is quite complex.
JSP:
i)No need of Recompilation & Reloading when we do modifications in a JSP page.
ii)We need not to Configure a JSP in a “web.xml”.
iii)It is providing huge amount of Implicit Objects support.
iv)Since Html & Java code are separated hence no disturbance while changing logic.
v)It is providing implicit XML Exception Handling support.
vi)It is easy to learn & implement since it is tags based.
vii)It allows to develop custom tags.
viii)It gives JSTL support. (JSP Standard Tag LibraryIt provides more tags that will help to develop a JSP without using Java code).
 ix)It gives all benefits of Servlets.

 What is the difference b/w ActionServlet & Servlet?
ActionServlet: It is a predefined Singleton Java class and it traps all the requests coming to Server.It acts as a Front-Controller in Struts 1.x.
Servlet:  a Java class that extends HttpServlet/GenericServlet or implements Servlet interface and is a Server side technology to develop dynamic web pages.It is a Single instance multiple thread component. It need not be a Singleton Java class.

What are Access Specifiers & modifiers?
 i)public - Universal access specifier.
        can be used along with: class, innerclass, Interface, variable, constructor, method.                     
ii)protected - Inherited access specifier.
        can be used along with: innerclass, variable, method, constructor.
 iii)default - Package access specifier(with in the package).
        can be used along with: class, innerclass, interface, variable, constructor, method.
iv) private -Native access specifier.
        can be used along with: innerclass, variable, constructor, method         Some other access modifiers:
i) static------------innerclass,variable,block,method.
ii) abstract—----- class,method.
iii) final--------------class,variable,method.
iv) synchronized---block,method.
v) transient---------variable.
vi) native-------------method.
vii) volatile-----------variable
viii) strict fp-----------variable
         
Which JSP tag is  used to display error validation?
In Source page:   
    <%@page  errorPage=”error-page-name.jsp”>
In  Error page:
     <%@page  isErrorPage=”true”>


What are the roles of  EJBContainer ?
• An EJB container is the world in which an EJB bean lives.
• The container services requests from the EJB, forwards requests from the client to the EJB, and interacts with the EJB server.
• The container provider must provide transaction support, security and persistence to beans.
• It is also responsible for running the beans and for ensuring that the beans are protected from the outside world.


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email