Top 20 HTML Interview Questions and Answers
March 2, 2015
Top 15 ASP.Net Interview Questions and Answers
March 4, 2015
Show all

Top 21 J2EE Interview Questions and Answers

Java Platform, Enterprise Edition or Java EE is Oracle’s enterprise Java computing platform.

The platform provides an API and runtime environment for developing and running enterprise software, including network and web services, and other large-scale, multi-tiered, scalable, reliable, and secure network applications.

Java EE extends the Java Platform, Standard Edition (Java SE),[1] providing an API for object-relational mapping, distributed and multi-tier architectures, and web services.

J2EE is a platform-independent, Java-centric environment from Sun for developing, building and deploying Web-based enterprise applications online.


1. J2EE Stand for?
Java 2 Platform Enterprise Edition.

2. What are the components of J2EE application?
A J2EE component is a self-contained functional software unit that is assembled into a J2EE application with its related classes and files and communicates with other components.

3. The J2EE specification defines the following J2EE components:
Application clients and applets are client components.
Java Servlet and JavaServer PagesTM (JSPTM) technology components are web components.
Enterprise JavaBeansTM (EJBTM) components (enterprise beans) are business components.
Resource adapter components provided by EIS and tool vendors.

4. What are the the types of J2EE modules?
Application client module
Web module
Enterprise JavaBeans module
Resource adapter module

5. What does web module contain?
The web module contains:
JSP files,
class files for servlets,
GIF and HTML files, and
a Web deployment descriptor.
Web modules are packaged as JAR files with a .war (Web ARchive) extension.

6. JSF Stand for?
JavaServer Faces (JSF)

7. What is JSF?
JSF is a user interface, it is use for designing framework for Java web applications.

8. What is Hibernate?
Hibernate an open source Java persistence framework project. Perform powerful object relational mapping and query databases using HQL and SQL.

9. Advantages of Hibernate?
Database Independent
JPA Provider
Built-In Connection Pool Implementation
Layered Architecture
Standard ORM
Hibernate is better than plain JDBC
Mapping of Domain object to relational database

10. cons of hibernate?
Lots of API to learn
Slower than JDBC
Not suitable for Batch processing

11. What is ORM?
Object-relational mapping (ORM, O/RM, and O/R mapping) in computer science is a programming technique for converting data between incompatible type systems in object-oriented programming languages.

This creates, in effect, a “virtual object database” that can be used from within the programming language.

12. Benefits of Object-Relational Mapping (ORM)
Application design
Code Reuse
Application Maintainability

13. HQL stands for?
Hibernate Query Language

14. What is HQL?
Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties. HQL queries are translated by Hibernate into conventional SQL queries which in turns perform action on database.

15. What is the difference between a .jar, .war and .ear file?
In J2EE application modules are packaged as EAR, JAR and WAR based on their functionality

JAR: EJB modules which contains enterprise java beans class files and EJB deployment descriptor are packed as JAR files with .jar extenstion

WAR: Web modules which contains Servlet class files,JSP FIles,supporting files, GIF and HTML files are packaged as JAR file with .war (web archive) extension

EAR: All above files (.jar and .war) are packaged as JAR file with .ear (enterprise archive) extension and deployed into Application Server.

16. JSP Stands for?
JavaServer Pages

17. What is JSP?
JavaServer Pages (JSP) is a technology that helps software developers create dynamically generated web pages based on HTML, XML, or other document types. Released in 1999 by Sun Microsystems, JSP is similar to PHP, but it uses the Java programming language.

18. What is Struts?
Struts is a discontinued open-source web application framework for developing Java EE web applications.

It uses and extends the Java Servlet API to encourage developers to adopt a model–view–controller (MVC) architecture.

19. What is Spring?
Spring helps development teams everywhere build simple, portable,. fast and flexible JVM-based systems and applications.

Spring is a light weight open source framework for the development of enterprise application that resolves the complexity of enterprise application development also providing a cohesive framework for J2EE application development. Which is primarily based on IOC (inversion of control) or DI (dependency injection) design pattern.

20. Benefits of Using Spring Framework?
Spring is Lightweight container
No App Server Dependent – like EJB JNDI Calls
Objects are created Lazily , Singleton – configuration
Components can added Declaratively
Initialization of properties is easy – no need to read from properties file
Declarative transaction, security and logging service – AOP

21. What is servlet?
A Java servlet is a Java programming language program that extends the capabilities of a server. Although servlets can respond to any types of requests, they most commonly implement applications hosted on Web servers.