Java is divided into 3 Phases:

1)      JSE ( Java Standard Edition)

2)      JEE ( Java Enterprise Edition)

3)      JME ( Java Mobile/Micro Edition)

Introduction to J2EE:

J2EE Stands for java enterprise edition, works as a specification. J2EE specification contains rules, guidelines to develop webserver as well as application server software like weblogic, tomcat etc. Working with J2EE is nothing but working with one or other webservers or app server software to develop the applications. J2EE phase concepts are servlets , JSP ( Java Server Pages), EJB, JTA ( Java Transaction API), JCA ( Java Connector API), JAAS ( Java Authentication and authorization service). J2EE Interview questions are very important because majority projects of JAVA environment will be developed based on J2EE Phase. Best examples domains are banking financial service, insurance companies, healthcare.

Question and Answers on J2EE Interview Questions

Question 1) Using j2ee Modules which application can be developed

Answer) Web applications also know as websites, n-tier apps, enterprise apps, distributed apps

Question 2) What is Latest Version Module of J2EE?

Answer) 6

Question 3) What is the difference between Static block and Constructor explain with suitable example?

Answer) Static block is class level one time execution block. When JVM ( Java Virtual Machine) loads java class the static block of that class executes automatically. This block is useful to initiate static member variables of a class.

Constructor is object level one time execution block when JVM created object for a class then the constructor of that class executes once automatically. It is useful to initiate variables of object.

J2EE Interview Questions Example Application to Understand Static block and Constructor

Class Micro

{

Static

{

system.out.println(“Micro: static block”);

}

Micro()

{

system.out.println(“Micro: constructor”);

}

Class Test

{
Static

{

system.out.println(“Micro: static block”);

}

Test()

{

system.out.println(“Micro: constructor”);

}

Public Class TestApp

{

Static

{

system.out.println(“Test App: static block”);

}

Public Static void main( string args[])

{
system.out.println(“Test App: main()”);

Micro M1=new micro();

Micro M2=new micro();

Class.forname(“test”);

Class.forname(“test”)

}
}

Out Put of the J2EE Interview Questions Example Application to Understand Static block and Constructor:

Test App: Static Blcok

Test App: Main ()

Micro: static block

Micro: constructor

Micro: constructor

Test: Static Blcok

With Respect to above application we can see JVM loading java classes in the following situations.

a)      While creating first object for given java class

b)      When class.for name() method is called

c)       When Java class is given to “JAVA Tool” for execution

Question 4) How Many ways are there to create object in java class?

Answer)

a)      by using new keyword

b)      by using static factory method

c)       by using instance factory method

d)      by using deserialization process

e)      by using cloning process

f)       by using factory pattern

g)      by using newInstance

One of the commonly asked question on J2EE Interview Questions is How Many ways are there to create object in java class? So friends be well prepared for J2EE Interview and hope you get your dream job.