Ans: J2EE is a platform-independent, Java-centric environment from Sun for developing, building and deploying Web-based enterprise applications online. The J2EE platform consists of a set of services, APIs, and protocols that provide the functionality for developing multitiered, Web-based applications.
Ans: Java is a general purpose, high-level programming language developed by Sun Microsystems. The Java programming language was developed by a small team of engineers, known as the Green Team, who initiated the language in 1991. The language was originally called OAK, and at the time it was designed for handheld devices and set-top boxes. Oak was unsuccessful and in 1995 Sun changed the name to Java and modified the language to take advantage of the burgeoning World Wide Web.
Ans: Core Java is something that provides the API's like regular expression, String handling, collections. But enterprise java involves writing scalable, secure and per-formant applications which can have large user base.
Ans: - The J2EE components consist of the functional unit that is used in the application and all the classes of it are also will get used to communicate with various components.
- The J2EE is having several components like :
Ans: The web client is very important part and it has other two parts that defines the way it functions :
Ans: Applets are client application that is small in size and it is included in the web tier. It provides the tools to communicate with the users and allow the drawings to be made by using the graphical interface. The applets are written in Java language. This gets executed on the virtual machine used by the Java and installed on the web browser. The plug in required by the client system for the use of security policy that executes the application in the web browser successfully. The components use API keys for creating the web client programs and run the application on the client side. As, no security is allowed the files are not required on the client system. It presents more modular approach to design the application using applets.
Ans: Application client runs on the client side and provide a way to the user to handle the task that is allowing the user to use the interface. The interface that is provided is graphical and tools are given for the help. The graphical user interface is created using swing and advanced window toolkit from the command line interface. These clients can use the applications directly due to the applications being handled at the business tier. The application client communicates throughout the HTTP connection using the servlet and the Java beans component architecture. The application client also includes various components to manage the overall data flow for the communication purpose between the server and the client.
Ans: JavaBeans components allow an object to be used to use the instance variables. The instance variables consist of get and set methods that are used on the server side to get the data information from the user and set it in the server. It provides lot of variations and elements can be used for the client tier. The client communicates through the business logic that is being provided by the server to run the applications. The web browser is used to communicate through the server by going through the pages that is being made and the transfer happens from the web tier. The J2EE application uses thin client or thick client that provides the lightweight and heavyweight functionality to the client and keep the load also to minimal on the server as well.
Ans: Containers acts as an interface between a platform and a component that is at the low level and it provides the functionality that is supported by the component. Application clients get executed first and then the beans. It keeps the beans assembled at one place so that it can be used and deployed using the containers. The application consists of the components that are platform specific so the containers allow them to be bundled at one place and then used in the application just by giving the name and the path. The assembling of the beans requires the configuration settings to be seen for each component that is used inside the J2EE application or just by J2EE.
Ans: J2EE server supports the customization of the server by providing the services like security, transaction management, Java naming directory and other services that can be used to provide the component based architecture.
There are different types of containers that exist :
Enterprise JavaBeans (EJB) container :
This is the container that manages the execution of the beans used for J2EE applications.
Ans:
Ans: Composition - has-a relationship between classes.
Inheritance - is-a relationship between classes.
Composition - Composing object holds a reference to composing classes and hence relationship is loosely bound.
Inheritance - Derived object carries the base class definition in itself and hence its tightly bound.
Composition - Used in Dependency Injection
Inheritance - Used in Runtime Polymorphism
Composition - Single class objects can be composed within multiple classes.
Inheritance - Single class can only inherit 1 Class.
Composition - Its the relationship between objects.
Inheritance - Its the relationship between classes.
Ans: J2EE application creation requires some modules and tools that are created to deliver the archive file.
The archive file is used with any archive manager but it is termed as the standard java archive file (JAR) that consists of the interfaces and components together in one.
It consists of the application and deployment tools to create the EAR file and adding them in the JAR file. The tools that are used:
Ans: Enterprise Bean Developer platform uses many services for different components and it is always required that the task has to be mentioned such as:
- JAR file is an important file that consists of all the archived files and is used by the Java itself. It is used to perform the following tasks:
Ans: Web Component Developer is related to the web services provided to the client for their use and functionality. The WAR file consists of the web component and performs various tasks on them.
The tasks that are performed as follows:
Ans: Application assembler is used to receive the application component from the client in a JAR file and then assembling of the file take place using the J2EE component facilities. Various functionalities are used to assemble the application components.
Assembler is also known as the deployed that is allowed to modify the deployment descriptor. The modification can be performed directly or by using the tool correctly that allow the XML tags to be modified using the graphical user interfaces.
The assembler works as:
Ans: The application deploying and administrating allow the user to configure and deploy the application components in the J2EE application. The administration of the computing can be done to find out the infrastructure that is being used. The networking resources are also included in this, which allows the server to get the configuration for it and allow the client to request the application that is required. It allows the applications to run in the environment that is provided. The models that are used in this include the transaction control, security control models that allow the specification to be provided for the use of database connection. This allow the communication be done between the different components.
Ans: When the configuration that has to be applied is set then the content that is provided with it is used to resolve the dependencies that are coming from outside and allow user to modify the security setting and assign transactions parameters to make it more secure.
The steps that are involved in installing and configuring the J2EE application requires:
Ans: The J2EE API allows the system and applications to integrate the components that are being provided with it.
It enables this by the following methods and ways:
Ans: J2EE provides a reference to all the components that it is using to allow an application deployment tool to be used for various purposes.
The deployment tool is used to assemble, verify, and deploy the J2EE applications.
These tools are used to automate the procedure of writing and compiling a code. The tools can be used using the command line or the graphical user interface.
The interface is used as graphical and allows configuring different components of the J2EE as :
Ans: To create the application in J2EE it requires to have predefined components that need to be used in order to successfully execute the application. The components that are used, enterprise bean, application client and the web component. To build the component it is necessary to create an application. This file name can be given according to the requirement and this will get stored in the EAR file like file-name.ear. The procedure that is followed for this is :
Ans:
Ans: J2EE is a platform that uses multi-tiered distributed application divided into components that are divided on the basis of function, applications and other components that gets installed with the platform.
There are different parts that are used for this multi-tiered application :
Ans: The J2EE components of an application are packaged separately and then are bundled into a J2EE application. All the related files of a component such as the html, server utility classes etc. are clubbed together along with a deployment descriptor and assembled into a module. This module can be added to a J2EE application. The deployment descriptor is made using an xml file and it defines a components deployment settings. A J2EE application comprises of one or multiple enterprise bean, web or client component modules. Every J2EE application and the modules that make it have their own deployment descriptor file. Depending upon the design requirements the final enterprise solution may consist of one or more J2EE applications.
Ans: "equals" is the method of object class which is supposed to be overridden to check object equality, whereas "==" operator evaluate to see if the object handlers on the left and right are pointing to the same object in memory.
x.equals(y) means the references x and y are holding objects that are equal. x==y means that the references x and y have same object.
Sample code:
String x = new String("str");
String y = new String("str");
System.out.println(x == y); // prints false
System.out.println(x.equals(y)); // prints true
Ans: If the Object value will not change, use String Class because a String object is immutable.
If the Object value can change and will only be modified from a single thread, use StringBuilder because StringBuilder is unsynchronized(means faster).
If the Object value may change, and can be modified by multiple threads, use a StringBuffer because StringBuffer is thread safe(synchronized).
Related Interview Questions...
Core Java Interview Questions And Answers
Core Java Programming Interview Questions and Answers
Multithreading in Java Interview Questions and Answers
Javascript Interview Questions
Java Interview Questions and Answers
Java Collections Interview Question and Answers
Interview Questions For Selenium with Java
Java Web Services Interview Questions and Answers
Tricky Java Interview Questions and Answers