J2EE Interview Questions and Answers

bookmark

Categories

J2EE


J2EE Interview Questions and Answers Online Training

Enroll Today

Top J2EE Interview Questions and Answers - 2021 [UPDATED]

Are you looking for J2EE Interview Questions and Answers? Than you are at the Right Place. Browse through Popular and Most Asked Interview Questions for J2EE.  There is a Huge Demand for J2EE Professionals in the Market. These Questions are suitable for both Freshers and Experienced Professionals and are based on Trending Topics and as per Current Industry Requirements.

Master These Topics and Increase your Chances in cracking J2EE Interviews like a pro and Secure your Dream Job Today.

J2EE Interview Questions and Answers

  • 40 Questions

Java 2 Enterprise Edition (J2EE) platform used to develop web-based applications. It consists of Application Programming Interface (API), a set of services, and protocols for managing, developing, and deploying the applications of multi-tier server-centric. It provides a stable and secured Java platform to the enterprise.

There are four types of components in J2EE applications. Application Clients Components (Client-tier components) JSP technology and servlet (Web-tier components) Resource Adapter Components Business-tier components

J2EE Clients are of four types: Application Clients Applets Wireless clients (based on MIDP technology) Java Web Start clients

Servlet: Servlet is a side component that creates a server-side program by providing a powerful mechanism. Servlets can be available for different protocols. It is an independent server platform. Hypertext Transfer Protocol (HTTP) is the most commonly used protocol of Servlet. Phases in Servlet Lifecycle: There are five phases in Server Lifecycle: Classloading phase Instantiation phase Initialize phase Request Handling phase Removal phase

Java Server Pages and Java Servlet technology components are referred to as web components. JSP (Java Server Pages) allows a more natural approach in the creation of static content. Servlet is a Java programming language that receives the request and answers it.

Java Server Faces (JSF) acts as a User Interface (UI) for Java web applications in designing a framework. JSF is based on Model View Controller (MVC) pattern. It saves form data on the server-side and populates it on the client-side.

J2EE is needed for Independent Software Vendors because it gives a blueprint to provide the solution of expertise computing on the Java platform. The expertise developers also need J2EE to get high productivity in writing distributed applications of business.

J2EE Container is the interface between a low-level platform and a component. In other words, the J2EE Container is termed as a framework that provides relevant services to the Application server.

Model: It represents the system’s internal state as a set of many Java Beans. View: It can be constructed by using the technology Java Server Pages (JSP). Controller: It is the process of producing the next level of user interface as per the request and focuses request receiving by the client.

Hashtable is defined as the collection of synchronized objects. It is like a HashMap and value keys. It doesn’t allow duplicate values.

Hibernate: A query service and an object-relational mapping which allows writing Hibernate Query Language (HQL) is known as Hibernate. It doesn’t allow us to write Structured Query Language (SQL) scripts. Hibernate is faster than SQL, which has compelling object-oriented contents like inheritance, associations, and polymorphism. Hibernate consists of substantial collections and persuasive compositions. It allows query makings by using the Java-based approach. Limitations of Hibernate: In HQL query execution, it takes more time than the usual period. There are no shared reference values. It prevents the options of advanced query and supports only composite keys.

Object-Relational Mapping (ORM): It is defined as the Java class mapped objects to the relational database metadata tables which describe object mapping and database. The working method of ORM is to transform one representation form data into another form. Advantages of ORM: Productivity: It reduces the data access coding time with automatic code creation on the data defined model. Maintainability: The codes generated from Object-Relational Mapping are tested well. The developer needs to correct only functionality. Performance: The Object-Relational Mapping code manages the application data access. There is no need for creating data access code and optimize the speed up of the process. V endor Independence: The code generated from Object-Relational Mapping does not depend on the vendor. It increases the application portability.

Usage of method save(): The method is used to store the object in the database. Before inserting it, there is a check for duplicate records in hibernate. Usage of method saveorupdate(): The method is used to update the object by using an identifier. If the identifier value is zero, then this method directs to call save().

Load(): This method never returns null and can’t find the object from dthe atabase or cache. Get(): If the object can’t found then get() method returns null. Get() method never returns a proxy, whereas load() returns proxy.

Connection Pooling: A mechanism which helps in re-using the existing connections is known as Connection Pooling. This pooling mechanism maintains object-oriented connections which were already created. Without creating a new connection, this Pooling mechanism directly uses the existing connection.

Core Interfaces of Hibernate: SessionFactory Interface Transaction Interface Session Interface Configuration Interface Criteria and Query Interface Collection types in Hibernate: List Set Array Bag Map

A J2EE license has signed as the J2EE commercial distribution license. It means the license commits compatibility and compatible tests. It doesn’t convey the meaning that the products are compatible. The J2EE brand has significantly passed the Compatibility Test Suite (CTS).

Java EE 5SDK is used to Java EE 5 and its complete implementation to help the developers in learning improved specifications. Java EE 5 includes Java SE platform, Server Platform Edition 9 and various other tools to help the prototype of Java EE application developers.

Thin Client: A program interface to the application that doesn’t have the operations like a complicated business, database queries, or third-party application connection is known as the Thin Client. Hibernate Proxy: An object proxy that avoids retrieving of an object until the user needs it. Hibernate doesn’t make the proxy of objects by default.

.jar files: These files are work with .jar extension. The .jar files contain accessories, resources, and libraries like property files. .war files: These files are work with .war extension. The .war files contain JavaScript, HTML, JSP, and other necessary files for web application development. .ear files: These files contain application EJB modules.

The JSP tags are divided into four types: Declaratives Directives Expressions Scriptlets

The following are the JSP Directives: Include Directives (include= header.jsp) Page Directives (page language= java) Taglib Directives (prefix=html & taglib uri= tlds/taglib.tld)

An MVC architecture which is used to design large-scale applications is called a Struts framework. It is the combination of Java Server Pages, Java Servlets, message, and Custom tags. Struts are used to create a development environment to the application based on the proven design patterns and published standards. Model in applications represents the system’s internal state as a set of many Java Beans. A view can be constructed by using the technology Java Server Pages (JSP). The controller produces the next level of user interface as per the request and focuses request receiving by the client. Class Action Servlet is the primary component in the controller framework. These action servlet configured by using the ActionMapping sets.

ActionMapping: In ActionMapping, the user specifies action class a particular URL like target views and paths at which the request-response starts forwarding. The ActionMapping also represents the mapping of a request for a specific class of action that an ActionServlet knows. The mapping can pass to the Action class execute() method by enabling information access directly. ActionForm: A Java Bean that associates with ActionMapping are known as ActionForm. A Java Bean becomes FormBean when it extends .apache .org. Action. Structs. ActionForm class. On the server-side, the object of ActionForm is populated at which UI client enters the data. ActionForm maintains web application session state.

There are seven core modules in the spring: Object/Relational Mapping module Core Container module Application Context module Web module Aspect-Oriented Programming DAO module Mobile View Controller (MVC) module

The following are the functions of RequestProcessor and ActionServlet: Handling Content type Issues Populating Java Bean Receiving request from HttpServlet Providing extension points Displaying web page issue response

Web Module contains: Servlets Class files Java Server Page files HTML and GIF files Web Deployment Descriptor

The following are some of the significant advantages of Hibernate: Hibernate can map the Domain objects to the relational database. It is independent of vendor and database; that’s why it is called a portable framework. When compared to JDNS, Hibernate has better connectivity of database.

EJB (Enterprise Java Beans): EJB is a component in the server-side that encapsulates the business logic and executes in an EJB container for the enterprise application. System services provided by EJB container: Security Connection pooling Component lifecycle management Persistence Transaction Threading

The applications of EJB are loosely coupled. The interfaces specify EJB application behaviour. In the client-side, the implementation can be hidden. The Application API lies in the session tier. It supports application developer. The data source API lies in entity tier.

There are three types of JSP directives available: Include directive Page directive Taglib directive

Expression element: It is the element which is used to write dynamic content into the client browser. Comments types that are supported by JSP: JSP comment HTML comment

EJB components doesn’t maintain resources. It has the components of integration support from the vendors. The client interactions are specifying the java interfaces. The assembled applications are separated from source components. Portability support. Detailed knowledge about EJB components.

JNDI: Java Naming Directory Interface (JNDI) is used to access directory service data. JTA: Java Transaction API (JTA)is used to manage and coordinate the transactions of the information enterprise system. JMS: Java Messaging Service (JMS) is used to send and receive messages by using messaging systems.

Client Tier: The client tier indicates the browser from which the server request processed. The interfaces of client tier are Java application, HTML browser, non-Java application or an applet. Middle Tier: Middle tier comprises of integration tier and presentation tier. In this, the User Interface (UI) is created at the presentation tier by using Javaserver pages. The business logic can be written with enterprise Java bean inside the business tier. The database objects can be created in the integration tier. Backend: The backend contains the Enterprise Information System (EIS), and it is used in data stores.

Security Socket Layer (SSL): The technology which is used to communicate between the web browser and the web server is known as Security Socket Layer (SSL). Usually, SSL is also referred to as a protocol which describes how to use encryption algorithms. This technology establishes encrypted link in among parties and allows sensitive information transmission like debit/credit card, login credentials, and social security numbers.

The spring application is used to development testability of applications. The Plain Old Java Object (POJO) is based on the facility development in re-using the existing components. It also improves maintainability by reducing code coupling. It is possible to reduce cost by improving application productivity. It doesn’t need an application server.

Action form is a java bean which is associated with multiple action planning. The objects of action form are populated at the server end when the data entered from the user interface (UI). Action form also maintains web application session states.

Service Availability: The availability of application must have 24/7 support. The app doesn’t require customer service representatives. Data Connectivity: The application should connect to the legal systems and mainframe systems in making the business functions as usual. User Interaction: The user should connect application from laptop, desktop, mobile, and PDA. Accessibility: The user should connect application from any electronic devices. Flexibility: The developer must concentrate on business logic, and the server will handle remaining services.

The following are the roles of a J2EE Architect: Creating a blue system Defining functional and non-functional requirements. Visualizing system behaviour. Integration of non-functional requirements to the system. Defining the working process of system elements.