If you're looking for J2EE Interview Questions for Experienced or Freshers, you are in right place. There are a lot of opportunities from many reputed companies in the world. According to research J2EE has a market share of about 7.0%. So, You still have the opportunity to move ahead in your career in J2EE Development. Mindmajix offers Top J2EE Interview Questions 2021 that helps you in cracking your interview & acquire a dream career as a J2EE Developer.
Enthusiastic about exploring the skill set of J2EE? Then, have a look at the J2EE Online Training together with additional knowledge.
J2EE Interview Questions and Answers - Table of Content
Advanced J2EE Interview Questions and Answers
1Q. What is the Java 2 Platform Enterprise Edition (J2EE)?
Ans: The Java 2 Platform Enterprise Edition (J2EE) is a set of coordinated specifications and practices that together enable solutions for developing, deploying, and managing multi-tier server-centric applications. Building on the Java 2 Platform, Standard Edition (J2SE), the J2EE platform adds the capabilities necessary to provide a complete, stable, secure, and fast Java platform to the enterprise level. It provides value by significantly reducing the cost and complexity of developing and deploying multi-tier solutions, resulting in services that can be rapidly deployed and easily enhanced.
[Related Article: Java Tutorial]
2Q. What are the main benefits of the J2EE platform?
Ans: The J2EE platform provides the following:
Complete Web services support. The J2EE platform provides a framework for developing and deploying web services on the Java platform. The Java API for XML-based RPC (JAX-RPC) enables Java technology developers to develop SOAP-based interoperable and portable web services. Developers use the standard JAX-RPC programming model to develop SOAP-based web service clients and endpoints. A web service endpoint is described using a Web Services Description Language (WSDL) document. JAX-RPC enables JAX-RPC clients to invoke web services developed across heterogeneous platforms. In a similar manner, JAX-RPC web service endpoints can be invoked by heterogeneous clients.
It provides faster solutions delivery time to market. The J2EE platform uses “containers” to simplify development. J2EE containers provide for the separation of business logic from resource and lifecycle management, which means that developers can focus on writing business logic — their value add — rather than writing enterprise infrastructure. For example, the Enterprise JavaBeans (EJB) container (implemented by J2EE technology vendors) handles distributed communication, threading, scaling, transaction management, etc. Similarly, Java Servlets simplify web development by providing infrastructure for component, communication, and session management in a web container that is integrated with a web server.
It provides freedom of choice. J2EE technology is a set of standards that many vendors can implement. The vendors are free to compete on implementations but not on standards or APIs. Sun supplies a comprehensive J2EE Compatibility Test Suite (CTS) to J2EE licensees. The J2EE CTS helps ensure compatibility among the application vendors which helps ensure portability for the applications and components written for the J2EE platform. The J2EE platform brings Write Once, Run Anywhere (WORA) to the server.
It provides simplified connectivity. J2EE technology makes it easier to connect the applications and systems you already have and bring those capabilities to the web, to cell phones, and to devices. J2EE offers Java Message Service for integrating diverse applications in a loosely coupled, asynchronous way. The J2EE platform also offers CORBA support for tightly linking systems through remote method calls. In addition, the J2EE platform has J2EE Connectors for linking to enterprise information systems such as ERP systems, packaged financial applications, and CRM applications.
By offering one platform with faster solution delivery time to market, freedom of choice, and simplified connectivity, the J2EE platform helps IT by reducing TCO and simultaneously avoiding single-source for their enterprise software needs.
3Q. Can the J2EE platform interoperate with other WS-I implementations?
Ans: Yes, if the other implementations are WS-I compliant.
4Q. What technologies are included in the J2EE platform?
Ans: The primary technologies in the J2EE platform are: Java API for XML-Based RPC (JAX-RPC), JavaServer Pages, Java Servlets, Enterprise Java Beans components, J2EE Connector Architecture, J2EE Management Model, J2EE Deployment API, Java Management Extensions (JMX), J2EE Authorization Contract for Containers, Java API for XML Registries (JAXR), Java Message Service (JMS), Java Naming and Directory Interface (JNDI), Java Transaction API (JTA), CORBA, and JDBC data access API.
5Q. What’s new in the J2EE 1.4 platform?
- The Java 2 Platform, Enterprise Edition version 1.4 features complete Web services support through the new JAX-RPC 1.1 API, which supports service endpoints based on servlets and enterprise beans. JAX-RPC 1.1 provides interoperability with Web services based on the WSDL and SOAP protocols. The J2EE 1.4 platform also supports the Web Services for J2EE specification (JSR 921), which defines deployment requirements for Web services and utilizes the JAX-RPC programming model. In addition to numerous Web services APIs, J2EE 1.4 platform also features support for the WS-I Basic Profile 1.0. This means that in addition to platform independence and complete Web services support, J2EE 1.4 offers platform Web services interoperability.
- The J2EE 1.4 platform also introduces the J2EE Management 1.0 API, which defines the information model for J2EE management, including the standard Management EJB (MEJB). The J2EE Management 1.0 API uses the Java Management Extensions API (JMX). The J2EE 1.4 platform also introduces the J2EE Deployment 1.1 API, which provides a standard API for the deployment of J2EE applications.
- The J2EE platform now makes it easier to develop web front ends with enhancements to Java Servlet and JavaServer Pages (JSP) technologies. Servlets now support request listeners and enhanced filters. JSP technology has simplified the page and extension development models with the introduction of a simple expression language, tag files, and a simpler tag extension API, among other features. This makes it easier than ever for developers to build JSP-enabled pages, especially those who are familiar with scripting languages.
- Other enhancements to the J2EE platform include the J2EE Connector Architecture, which provides incoming resource adapter and Java Message Service (JMS) pluggability. New features in Enterprise JavaBeans (EJB) technology include Web service endpoints, a timer service, and enhancements to EJB QL, and message-driven beans. The J2EE 1.4 platform also includes enhancements to deployment descriptors. They are now defined using XML Schema which can also be used by developers to validate their XML structures.
[Related Article: J2EE Tutorial]
6Q. What is the J2EE 1.4 SDK?
Ans: The Java 2 SDK, Enterprise Edition 1.4 (J2EE 1.4 SDK) is a complete package for developing and deploying J2EE 1.4 applications. The J2EE 1.4 SDK contains the Sun Java System Application Server Platform Edition 8, the J2SE 1.4.2 SDK, J2EE 1.4 platform API documentation, and a slew of samples to help developers learn about the J2EE platform and technologies and prototype J2EE applications. The J2EE 1.4 SDK is for both development and deployment.
7Q. Which version of the platform should I use now — 1.4 or 1.3?
Ans: The J2EE 1.4 specification is final and you can use the J2EE 1.4 SDK to deploy applications today. However, for improved reliability, scalability, and performance, it is recommended that you deploy your applications on J2EE 1.4 commercial implementations that will be available early in 2004.
If you want to deploy your application before 2004, and reliability, scalability, and performance are critical, you should consider using a high-performance application server that supports J2EE v1.3 such as the Sun Java System Application Server 7. Many application server vendors are expected to release J2EE platform v1.4 versions of their product before the spring.
8Q. Can applications are written for the J2EE platform v1.3 run in a J2EE platform v1.4 implementation?
Ans: J2EE applications that are written to the J2EE 1.3 specification will run in a J2EE 1.4 implementation. Backward compatibility is a requirement of the specification.
9Q. How are the J2EE architecture and the Sun Java Enterprise System-related?
Ans: The J2EE architecture is the foundation of the Sun Java System Application Server, a component of the Sun Java Enterprise System. The Sun Java System Application Server in the current Sun Java Enterprise System is based on the J2EE platform v1.3, with additional support for Web services.
Developers familiar with J2EE technology can easily apply their skills to building applications, including Web services applications, using the Sun Java Enterprise System. For more information, see the Sun Java Enterprise System Web site.
10Q. Can I get the source for the Sun Java System Application Server?
Ans: You can get the source for the J2EE 1.4.1 Reference Implementation from the Sun Community Source Licensing site. The J2EE 1.4.1 Reference Implementation is the Sun Java System Application Server Platform Edition 8 minus the following components:
- The installer
- The Web-based administration GUI
- JavaServer Faces 1.0 and JSTL 1.1
- Solari's specific enhancements for security and logging
- Higher performance message queue implementation
11Q. What tools can I use to build J2EE applications?
Ans: There are numerous choices of tools available for developing Java and J2EE applications. You can download the Open Source NetBeans IDE for free at NetBeans.org. Many of the J2EE compatible vendors offer tools that support any J2EE compatible application server.
12Q. Who needs the J2EE platform?
Ans: ISVs need the J2EE platform because it gives them a blueprint for providing a complete enterprise computing solution on the Java platform. Enterprise developers J2EE Tutorialed, because writing distributed business applications are hard, and they need a high-productivity solution that allows them to focus only on writing their business logic and having a full range of enterprise-class services to rely on, like transactional distributed objects, message-oriented middleware, and naming and directory services.
13Q. What does Sun mean by “Free” platform use?
- When Sun says “Free” it means that you don’t pay Sun to develop or deploy the J2EE 1.4 SDK or the Sun Java System Application Server Platform Edition 8. Free means that you don’t pay Sun for supplementary materials including documentation, tutorials, and/or J2EE Blueprints. You are also free to bundle and distribute (OEM) Sun Java System Application Server Platform Edition 8 with your software distribution. When we say “Free”, we mean “Free for all”.
Here are some examples of how you can use Sun Java System Application Server Platform Edition 8 for free.
- If you are a developer you can build an application with the J2EE 1.4 SDK and then deploy it on the Sun Java System Application Server Platform Edition 8 (included with the J2EE 1.4 SDK or available separately). No matter how many developers are on your team, all of them can use the J2EE 1.4 SDK at no charge. Once your application is ready for production, you can deploy including the Sun Java System Application Server Platform 8 Edition in production on as many servers or CPUs as you want.
- If you are an ISV, you don’t have to pay to include Sun Java System Application Server Platform Edition 8 with your product, no matter how many copies of your software that you distribute. Bundling Sun Java System Application Server Platform Edition 8 makes good business sense because it ensures that you are distributing a J2EE 1.4 platform compatible server that doesn’t lock you or your customers into a proprietary product. ISV’s that wish to bundle Sun Java System Application Server Platform Edition 8 (for free of course) should contact Sun OEM sales.
- If you are a System Administrator or IT manager, you can install Sun Java System Application Server Platform Edition 8 on as many servers and CPUs as you wish. Using Sun Java System Application Server Platform Edition 8 also gives reduced cost and complexity by saving money on licensing fees and the assurance of a J2EE 1.4 platform compatible application server that can be used with other J2EE 1.4 platform compatible application servers.
14Q. Is technical support “Free” as well?
Ans: There are resources that are available for free on the Sun Solaris website that may help you resolve your issues without requiring technical support. For example, you can ask questions on the forum, search for known issues on the bug data base, review the documentation, or take a look at code samples and applications to help you at no cost.
Production support is also available for a fee through Sun Service. For more information about Developer Technical Service and Sun Service, you can go visit here
15Q. Are there compatibility tests for the J2EE platform?
Ans: Yes. The J2EE Compatibility Test Suite (CTS) is available for the J2EE platform. The J2EE CTS contains over 5,000 tests for J2EE 1.4 and will contain more for later versions. This test suite tests compatibility by performing specific application functions and checking results. For example, to test the JDBC call to insert a row in a database, an EJB component makes a call to insert a row, and then a call is made to check that the row was inserted.
16Q. What is the difference between being a J2EE licensee and being J2EE compatible?
Ans: A J2EE licensee has signed a commercial distribution license for J2EE. That means the licensee has the compatibility tests and has made a commitment to compatibility. It does not mean the licensees’ products are necessarily compatible yet. Look for the J2EE brand which signifies that the specific branded product has passed the Compatibility Test Suite (CTS) and is compatible.
17Q. What is the relationship of the Apache Tomcat open-source application server to the J2EE SDK?
Ans: Tomcat is based on the original implementation of the JavaServer Pages (JSP) and Java Servlet specifications, which was donated by Sun to the Apache Software Foundation in 1999. Sun continues to participate in the development of Tomcat at Apache, focusing on keeping Tomcat current with new versions of the specifications coming out of the Java Community Source Process.
Sun adapts and integrates the then-current Tomcat source code into new releases of the J2EE SDK. However, since Tomcat evolves rapidly at Apache, there are additional differences between the JSP and Servlet implementations in the J2EE SDK and in Tomcat between J2EE SDK releases. Tomcat source and binary code is governed by the ASF license, which freely allows deployment and redistribution.
18Q. How is the J2EE different from Java EE 5 SDK?
Ans: The Java EE 5 SDK provides a complete implementation of the Java EE 5 specification along with extra features to help developers learn about what’s new and improved in the specification.
The Java EE 5 SDK includes the Sun Java System Application Server Platform Edition 9, the Java SE platform as its foundation, and various tools to help developers’ prototype Java EE applications and learn about the Java EE platform and technologies.
19Q. What is an EJB Platform?
Ans: The Enterprise JavaBeans or EJB platform handles functions such as transaction and state management, multithreading, resource pooling, and simple searches while you concentrate on writing business logic.
20Q. What is the JavaMail API?
Subscribe to our youtube channel to get new updates..!
Ans: The JavaMail API provides a set of abstract classes that model a mail system. The API provides a platform independent and protocol independent framework to build Java technology based email client applications.
21Q. What are the design goals of J2EE architecture?
Ans: The following are the design goals of J2EE architecture:
Service Availability: The application should be available 24 * 7. The business depends on the application without the need for customer service representatives
Data Connectivity: The application should be able to connect to mainframe systems and other legacy systems to ensure business functions as usual
Accessibility: User should be able to connect the application from anywhere and from any electronic devices
User Interaction: The user should be able to connect to the application from desktop, laptop, PDA, and mobile
Flexibility: The architecture should be created in such a way that the developer just concentrates on the business component model (business logic) and the rest of the services are handled by the server
22Q. What are the roles of J2EE Architect?
Ans: The following are the roles of J2EE architect:
- Visualizing the behavior of the system
- Creating the system blue print
- Defining the way how the system elements work together
- Defining non-functional and functional requirements
- Integrating non-functional requirements into the functional system
23Q. What is the difference between architecture and design?
Ans: Architecture defines the structural issues, communication protocols, data access, synchronization, and subsystems’ classification. It also defines the architectural design of the component interfaces.
In Design, we define the components to be created for each interface, the inputs, the outputs, algorithms, and data structures. In short, the designers describe each component’s internal details.
24Q. What are the activities performed in Architectural Analysis?
Ans: The following activities will be performed in Architectural Analysis:
Use case diagram: This is developed to depict the high level system functionality
Class Diagram: This is developed to depict the functionality as classes and methods
Collaboration Diagram: This is developed to depict how each class talk to each other
Sequence Diagram: This is developed to depict the operation sequence
25Q. What are the activities performed in Architectural Design?
Ans: The following activities will be performed in Architectural Design:
- The framework (example: Remote Method Invocation) to be used will be decided
- The software and hardware requirements are defined
- The performance parameter and the approach to achieve will be defined
- Analyze for reusing existing components or technology
- Define the business logic, security, and performance of the system
26Q. What are the activities performed in the object oriented design?
Ans: The following activities will be performed in object oriented design:
- Decide on how classes interact with packages
- Create dependency diagrams
- Create deployment diagrams
- Decide if the components (software) reside in deployment folder
27Q. What are the components of multi-tier architecture?
Ans: The following are the components of multi-tier architecture:
Presentation Tier: The front end component is present in this tier which is used to display the presentation
Resource Tier: The back end component is present in this tier which is used to communicate with database
Business Tier: The component present in this tier is used to provide business logic for the system
28Q. What are the advantages of multi-tier client server architecture?
Ans: The following are the advantages of multi-tier client server architecture:
- Changes to business logic or user interface can be made independently
- The client accesses data easily without knowing where data comes from and how many servers available for the system
- The DB (database) connections can be pooled so that the data can be shared for several users without making DB request for each user
- The middle tier component (business logic) can be written in any standard programming languages such as C or Java
29Q. What are the responsibilities of the bean developer?
Ans: The following are the responsibilities of the bean developer:
- Write the systems business logic in java
- Integrate java components with third party components
- Control access and set transaction parameters
- Create home interface to find the beans and remote interface to create business logic
- Create the deployment descriptor xml
30Q. What are the responsibilities of application assembler?
Ans: The following are the responsibilities of application assembler:
- Build presentation layer i.e., user interface
- Specify the requirements of transaction management
- Set transaction parameters for all the bean’s methods
- Define security roles and assign permissions
- Specify wild card character (*) to the methods
31Q. What are the responsibilities of bean deployer?
Ans: The following are the responsibilities of bean deployer:
- Map fields to DB (database) columns and manage persistence
- Define users, groups, roles, and manage security
- Use the deployment tools and generate wrapper classes
- Map user roles and groups
- Ensure all the deployed bean is assigned a transaction parameter
32Q. What are the roles of third party software in EJB framework?
Ans: The third party companies that provide the software can play any of the following three roles:
Component Provider: Responsible for developing object modeling, programming, architecture, and business process
Container Provider: Responsible for proving the environment during runtime to the server
33Application Server Provider: Responsible for providing a platform to develop distributed applications. It usually contains the container which provides the runtime environment
Ans: Q. Explain MVC architecture.
MVC represents Model View Controller architecture. The activity performed in MVC is explained below:
- In Model, the developer creates the business logic of the system
- In View, the developer creates the presentation logic
- In Controller, the developer receives the request and transfers the response
34Q. Explain EAR, WAR, and JAR.
Ans: EAR represents Enterprise Archive file. It contains the components of web, EJB, and client. All the components are packed in a compressed file called .ear file.
WAR represents Web Archive file. It contains all the components related to the web application. All the components are packed in a compressed file called .war file.
JAR represents Java Archive file. It contains all the class files and library files which constitute an API (Application Programming Interface). All the components are packed in a compressed file called .jar file.
35Q. Explain JTA, JNDI, and JMS.
Ans: JTA represents Java Transaction API. It is used for coordinating and managing transactions across enterprise information system.
JNDI represents Java Naming Directory Interface. It is used for accessing information from directory services.
JMS represents Java Messaging Service. It is used for receiving and sending messages through messaging systems.
36Q. Explain about EDI.
Ans: EDI represents Electronic Data Interchange. It is used for exchanging data through Value Added Network (VAN) which acts as the transmission medium.
EDI is expensive to install and requires customization by the exchanging clients. EDI also relies on X12 standards to interchange documents.
37Q. Explain EAI?
Ans: EAI represents Enterprise Application Integration. This makes one or more applications as single application and requires data to be transmitted to the appropriate system at the right time.
For example, while integrating sales and account systems, it is necessary for sales to send sales order to accounting to generate invoice. Also, accounting must send an invoice to sales to update data for the sales professionals.
This system handles transaction automatically across application and eliminates human errors.
38Q. What is the intent for supporting XML in Java?
Ans: The intent to support XML is to:
- Ensure Java developers understand XML easier and use XML and XML developers use Java
- Provide standard for Java to ensure consistent and compatible implementations
- Ensure java platform can be integrated with high quality
39Q. What are the protocols used for communicating between business tier and user interface?
Ans: The following protocols are used for communicating between business tier and user interface:
HTTP: It denotes ‘Hyper Text Transfer Protocol’
JMS: It denotes ‘Java Messaging Service’
RMI: It denotes ‘Remote Method Invocation’
CORBA: It denotes ‘Common Object Request Broker Architecture’
DCOM: It denotes ‘Distributed Component Object Model’
40Q. What are the advantages and disadvantages of HTTP protocol?
Ans: The following are the advantages of HTTP protocol:
- Stateless and firewall friendly
- Easier to load balance and scale HTTP servers
The following are the disadvantages of HTTP protocol
- Difficult to maintain user sessions
- Limited communication with JSP and servlets
41Q. Explain JRMP.
Ans: JRMP represents Java Remote Method Protocol. This is used by Remote Method Invocation (RMI) to pass java objects as arguments.
Since Java relies on Object Serialization which marshal objects as stream, RMI relies on the protocol JRMP to transfer objects from one JVM (Java Virtual Machine) to another.
42Q. What are the advantages and disadvantages of CORBA?
Ans: The following are the advantages of CORBA:
- Supports heterogeneous object
- Extends the capabilities of ORB (Object Request Broker)
The following are the disadvantages of CORBA:
- Objects cannot be passed, only arguments can be passed
- Accepted types of data can only be passed
43Q. Explain DCOM.
Ans: DCOM represents Distributed Component Object Model. This uses ORPC (Object Remote Procedure Call) protocol to support remote objects.
ORPC is built on top of RPC (Remote Procedure Call) and interacts with runtime services. DCOM supports multiple interfaces and the components can be created in various programming languages. Examples of languages are Java, C, Visual Basic, etc. DCOM is widely used in windows platforms.
44Q. Explain the capabilities of J2EE architecture.
Ans: The following are the capabilities of J2EE architecture:
Performance: performs functionality in a short time frame
Scalability: Supports even if the load on the server increases
Availability: The system is always accessible across 24 * 7
Flexibility: Change in hardware or architecture does not impact the system
Security: The information cannot be hacked and modified
Reusability: The component created for a system can be reused and save development time
45Q. Explain System architecture and Reference architecture.
Ans: System architecture represents the architecture as a product. This comprises the component functions, interfaces of the proposed system, constraints, and interactions. This is the base for application design implementation.
Reference architecture represents architecture as a method or style. For a specific domain, reference architecture refers coherent design principle.
46Q. Explain Best Practice.
Ans: Best Practice can be defined as follows:
- A technique that drives your application design at the component level
- Process recognized by the fellow team members who work on a similar project
- Takes design or system requirement into consideration
- Applicable to the entire software development life cycle
47Q. Explain the J2EE tiers.
Ans: J2EE has the following tiers:
Client Tier: It represents the browser from which a request is sent to the server. The interfaces used in this tier are HTML browser, java application, an applet, or a non-java application.
Middle Tier: It comprises of a presentation tier, business tier, and integration tier. The user interface is created in the presentation tier using JSP. The business logic is written in the business tier using EJB. The database objects are created in the integration tier.
Backend: This constitutes the Enterprise Information System (EIS) which is used to store data.
48Q. What are the best practices to be followed in the presentation layer?
Ans: The best practices to be followed in the presentation layer are explained below:
- Separate HyperText Markup Language (HTML) from java
- Always write business logic in a Bean class
- Use JSP templates and comments
- Use Model View Controller (MVC) Pattern
- Use custom libraries and tag handlers
49Q. What type of components is used in MVC?
Ans: MVC represents Model View Controller. The component used in Model, View, and Controller are explained below:
- An application represents the Model which constitutes the system’s state. The systems state is created as business logic in a Bean class
- The user interface represents the View which is created using Java Server Pages
- The request received from the client is always the controller which is created using Servlets
50Q. What are the requirements that a J2EE system must possess to operate in a global economy?
Ans: The J2EE system must possess the following to operate globally:
Financial Considerations: The method of payment to buy an item should contain many forms as not all the visitors will have a credit card. Also, a government has its own taxes, custom restrictions, and tariffs.
Language Requirements: The application should support multiple languages and it has to be country-specific.
Legal Differences: Customs laws and privacy requirements are different for each country and each government has restrictions on images, ideas, and speeches.
51Q. What are the best practices to be followed in DAO?
Ans: DAO represents Data Access Object. The best practices to be followed in DAO are explained below:
- DAO should not be coupled tightly to the business logic
- Each enterprise bean should be associated with a DAO class
- DAO should be used only to access data from DB
- DAO should be written in such a way that it allows cross schema and database capability
- DAO should be written in such a way that it supports portability
52Q. Explain Guideline.
Ans: Guideline refers to rule or agreement on operations which are developed by the professionally recognized organization or associations.
It also includes approved formal proprietary standards to be followed during the project activities.
An example of a Guideline is Analysts attempting to maximize data content to reduce network traffic.
53Q. What are the best practices to be followed in VO?
Ans: VO represents Value Object. The best practices to be followed in Value Objects are explained below:
- VO should contain business objects with getting and set methods
- VO should update the model bean object with the respective value
- VO should not reference an object on the server
- VO should represent a value from the server
54Q. What are the best practices to be followed in session bean façade?
Ans: The following are the best practices to be followed in session bean façade:
- It should reduce remote call to the application server
- Apply transactional scope to methods which call entity bean group
- Simplify the client tier code so that business logic gets executed only on the application server
- Coding should be done in such a way that it identifies user permissions and provide flexibility and reusability
55Q. What are the benefits of Model View Controller (MVC)?
Ans: The following are the benefits of MVC:
- Separates data model from user interaction and data display and clarifies application design
- Allows viewing data in many forms and by a large number of users
- Enhances reusability by separating functionality from presentation
- Increases flexibility and improves extensibility
- Encapsulates application functions and facilitates maintenance
- Supports incremental updates and divides deployment