J2EE interview questions for experienced/J2EE Interview Questions and Answers for Freshers & Experienced

What do you understand by business logic?

Business logic is the code that includes the functionality of an application. In the EJB (Enterprise JavaBeans) architecture, this logic is implemented by the methods of an enterprise bean.

Explain DCOM.

<> 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.

What are the advantages and disadvantages of CORBA?

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

Explain JRMP.

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 marshals objects as a stream, RMI relies on the protocol JRMP to transfer objects from one JVM (Java Virtual Machine) to another.

What are the main components of multi-tier architecture?

The main components of multi-tier architecture are:

<> Presentation Tier

The front-end component existing in this tier is used to display the presentation.

<> Resource Tier

The back-end component existing in this tier is used to communicate with the database.

<> Business Tier

The component existing in this tier is used to provide business logic for the system.

What is the file extension used for hibernate mapping file and hibernate configuration file?

For hibernate mapping, the file name should be like filename.hbm.xml.

For hibernate configuration, the file name should be like hibernate.cfg.xml.

What is B2b?

B2b indicates to business-to-business.

What does resource adapt module contain?

The resource adapter module contains the following:

Java interfaces
Classes
Native libraries
Other documentation
Resource Adapter deployment descriptor

What are the different types of JSP directive?

There are 3 different types of JSP directives available. These are:

<> Page directive
<> Include directive
<> Taglib directive

What is called the JSP directive?

JSP directive is the mechanism to provide metadata information to web containers about the JSP file. In the translation and compilation phases of the JSP life cycle, this Metadata is used by the web container.

What is the description of the expression element?

The expressions used for writing dynamic content back to the client browser are called expression elements.

What are the Basic and subtypes of Enterprise Java Beans (EJB)?

Two main types and subtypes of EJB are as follows:

* Session Beans

Stateful session beans
Stateless session beans

* Entity Beans

Bean Managed Persistence (BMP)
Container-Managed Persistence (CMP)
Message Driven Beans

What are the advantages of EJB components?

Advantages are:

* There is support for the integration of components from different vendors.
* Possibility to authorize the EJB component’s detailed knowledge of the environment.
* Possibility to assemble applications from separate component sources.
* Interaction with its clients is entirely specified in terms of Java interfaces.
* Portability support.
* It does not maintain resources.

What is URN?

URN stands for the Uniform Resource Name. It is a unique identifier that identifies an entity. But the information on where the entity is located is not available.

Explain EDI.

<> 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.

What is id URL?

URL stands for Uniform Resource Locator and it is the textual reference writing standard to an arbitrary piece of data in the World Wide Web (www). The general structure of the URL is as follows:

protocol://host/local info

<> protocol – Protocol is for fetching the object (example: HTTP, FTP)
<> host – Internet name of the targeted host.
<> local info – String is passed to the protocol handler on the remote host. In many cases, it is a file name with an extension.

Describe the Secure Socket Layer (SSL)?

The technology that is used to communicate between the web server and the web browser is called Secure Socket Layer (SSL). More specifically, SSL is a protocol that describes how algorithms are to be used in encryption.

The technology establishes an encrypted link between two parties and this link is allowed to secure transmission of sensitive information such as login credentials, credit/debit card information and social security numbers.

Describe the phases of the servlet lifecycle?

The phases of servlet lifecycle are:

<> Classloading phase – Web container loads the servlet class file (*.class).

<> Instantiation phase – By calling default no-arg constructor, the servlet class gets Instantiated.

<> Initialize phase – The method Init () called in this phase in only one time of the lifetime of a servlet. Servlet configuration is assigned to the servlet.

<> Request Handling phase – In this phase, only servlets spends most of the time. Servlet provides the services to various requests by calling Service ().

<> Removal phase – The destroy () function is called before servlet destruction. Garbage collection occurs later.

Discuss the benefit of the Spring Framework?

Benefits are as follows:

Possibility to organize middle-tier objects in an efficient way.
Easy initialization for properties.
Easily testable components.
Lightweight container.
Possibilities to use configuration management service of spring in any runtime environment with whatever architectural layer.

What are the advantages of using spring for application development?

Plain Old Java Object (POJO) based development facilitates to re-use existing components.
Possible to reduce development cost by improving the productivity of the application development.
Improve the testability of application with dependency injection.
Improve maintainability with reduced code coupling.
No need to have an application server and works on enterprise service.

What is the difference between load() and get()?

When the object is not available in either cache or database, the load() method throws an exception. No null values are returned from the load() method.

What is the use of method saveorupdate()?

In hibernate, method saveorupdate() is used to update an object using the identifier. When the value for the identifier is NULL then the method is directed to call save().

Explain JTA, JNDI, and JMS.

<> 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.

What must be implemented by all Servlets?

The Servlet Interface must be implemented by all servlets

Explain EAR, WAR, and JAR.

1> EAR represents the Enterprise Archive file. It contains the components of the web, EJB, and client. All the components are packed in a compressed file called the .ear file.

2> 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 the .war file.

3> JAR represents the Java Archive file. It contains all the class files and library files that constitute an API (Application Programming Interface). All the components are packed in a compressed file called .jar file.

What are the advantages of Object-Relational Mapping (ORM)?

Advantages are:

<> Productivity: Reduced time for data access coding with the help of automatic code creation base on the defined data model.

<> Maintainability: All code generated from ORM are well tested. Only the developer is required to create the correct functionality

<> Performance: The code generated from ORM completely manages the data access needs of the application. No need to create any data access code. Also, the code is optimized to speed up the data access process.

<> Vendor independence: The code generated from ORM does not depend on the vendor. This is to increase the portability of the application.

What are the phases of the servlet life cycle?

The life cycle of a servlet consists of the following phases:

<> Servlet class loading
<> Servlet instantiation
<> the init method
<> Request handling (call the service method)
<> Removal from service (call the destroy method)

What are different modules in spring?

There are seven core modules in spring

The Core container module
O/R mapping module (Object/Relational)
DAO module
Application context module
Aspect Oriented Programming
Web module
MVC module

What is the MVC on struts?

MVC stands Model-View-Controller.

Model: Model in many applications represent the internal state of the system as a set of one or more JavaBeans.

View: The View is most often constructed using JavaServer Pages (JSP) technology.

Controller: The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class ActionServlet. This servlet is configured by defining a set of ActionMappings.

What are the roles of third party software in the EJB framework?

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

What is action mapping??

In action mapping, we specify action class for particular URL ie path and different target view ie forwards on to which request response will be forwarded.The ActionMapping represents the information that the ActionServlet knows about the mapping of a particular request to an instance of a particular Action class.The mapping is passed to the execute() method of the Action class, enabling access to this information directly.

What is ActionForm?

ActionForm is a Java bean that associates one or more ActionMappings. A java bean become FormBean when extend org.apache.struts.action.ActionForm class. ActionForm object is automatically populated on the server side which data has been entered by the client from UI. ActionForm maintains the session state for a web application.

What is ActionErrors?

ActionErrors object that encapsulates any validation errors that have been found. If no errors are found, return null or an ActionErrors object with no recorded error messages.The default implementation attempts to forward to the HTTP version of this method. Holding request parameters mapping and request and returns set of validation errors, if validation failed; an empty set or null

What are Struts?

Struts framework is a Model-View-Controller(MVC) architecture for designing large-scale applications. It is a combination of Java Servlets, JSP, Custom tags, and message. Struts help you to create an extensible development environment for your application, based on published standards and proven design patterns. Model in many applications represents the internal state of the system as a set of one or more JavaBeans.The View is most often constructed using JavaServer Pages (JSP) technology.The Controller is focused on receiving requests from the client and producing the next phase of the user interface to an appropriate View component. The primary component of the Controller in the framework is a servlet of class ActionServlet. This servlet is configured by defining a set of ActionMappings.

What is the EAR file?

An EAR file is a JAR file with an .ear extension. A J2EE application with all of its modules is delivered in an EAR file.

What are the responsibilities of bean deployer?

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

What are the responsibilities of the application assembler?

The following are the responsibilities of the 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

What is the difference between .ear, .jar and .war files?

Each of these files consists of different elements which are processed distinctly by J2EE components such as servlet containers, EJB containers and applications servers.

.ear files consist of Web, EJB and client components.
.war files consist of files needed for web application development such as JavaScript, HTML and JSP.
.jar files consist of class files, library files, resource files and accessory files.

What are the responsibilities of the bean developer?

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

What are the advantages of multi-tier client-server architecture?

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

What are the components of multi-tier architecture?

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 the database

Business Tier: The component present in this tier is used to provide business logic for the system

What are the activities performed in the object oriented design?

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 the deployment folder

What are the activities performed in Architectural Design?

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

What are the activities performed in Architectural Analysis?

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

What is the difference between architecture and design?

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.

What are the roles of J2EE Architect?

The following are the roles of J2EE architect:

* Visualizing the behavior of the system
* Creating the system blueprint
* Defining the way how the system elements work together
* Defining non-functional and functional requirements
* Integrating non-functional requirements into the functional system

What are the design goals of J2EE architecture?

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: The 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

What is the JavaMail API?

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.

What is an EJB Platform?

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.

How is the J2EE different from Java EE 5 SDK?

<> 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.

Search
R4R Team
R4R provides J2EE Freshers questions and answers (J2EE Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,J2EE interview questions for experienced,J2EE Freshers & Experienced Interview Questions and Answers,J2EE Objetive choice questions and answers,J2EE Multiple choice questions and answers,J2EE objective, J2EE questions , J2EE answers,J2EE MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for J2EE fresher interview questions ,J2EE Experienced interview questions,J2EE fresher interview questions and answers ,J2EE Experienced interview questions and answers,tricky J2EE queries for interview pdf,complex J2EE for practice with answers,J2EE for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .