Showing posts with label java j2ee interview questions. Show all posts
Showing posts with label java j2ee interview questions. Show all posts

What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?

In request.getRequestDispatcher(path) in order to create it we need to give the relative path of the resource. But in   resourcecontext.getRequestDispatcher(path) in order to create it we need to give the absolute path of the resource.

scope values for the <jsp:useBean>?

The different scope values for are
1. page
2. request
3.session
4.application

Difference between JSP and Servlets

interview questions for JSP and Servlets only. Since JSP and Servlets are almost identical technology, there is only one section for both JSP and Servlet interview questions. If you need interview questions for any other java related technologies , please check the relevant sections. 
Difference between JSP and Servlets
JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP. But a servlet can support any protocol like HTTP, FTP, SMTP etc.

What is hybernate and spring?

Hibernate offers persistence and OR(Objet-Relational) mapping for Java/J2EE applications helping them improve performance and scalability.Spring is a light-weight Java framework which paves the way to write faster applications without App Server (or EJB etc.)There are a plenty of good books on these subjects. Following the most notable amongst them:Hibernate in Action by Christian Bauer, Gavin King (Hanning)Better, Faster, Lighter Java by Justin Gehtland, Bruce A. Tate ( O'Reilly)

Abstract Class or Method


Question:
Can we make use of "this" keyword reference inside a abstract method or Abstract Method?
Answer:
Yes You Can do that
For Example:
public abstract class TestExample{

private String exampleid;

private String examplename;

public TestExample(String exampleid ,String examplename)

{

this.exampleid= exampleid;

this.examplename= examplename;

}

//public gettors and settors

public abstract void scheduleTest();

}


public class JavaTestExample extends TestExample

{

private String typeName;

public JavaTestExample(String exampleid, String examplename, String typeName)

{

super(exampleid, examplename);

this.typeName =typeName;

}

public void scheduleTest()

{

//do Stuff

}

}



A class has a constructor so that when an instance of the Class is created
the fields of the class can be setup to a initial valid state.

Abstract classes define partial implementation of a public contract. Which
means that it may implement some of the methods and contains partially
implemented methods that are marked abstract.

Since abstract classes can have partial implementation and such partial
implementation can include fields of the class a constructor becomes necessary
so that those fields are initialized to a valid default state when they are
created thru the constructor of their concrete subclasses.

All abstract class are not pure abstract partially they are. So if you
need a pure abstract class go for an Interface.

J2EE Interview Questions


1)What is J2EE?

2)What is the J2EE module?

3)What are the components of J2EE application?

4)What are the four types of J2EE modules?

5)What does application client module contain?

6)What does Enterprise JavaBeans module contain?

7)What does resource adapt module contain?

8)How many development roles are involved in J2EE application?

9)What is difference between J2EE 1.3 and J2EE 1.4?

10)Is J2EE application only a web-based?

11)Are JavaBeans J2EE components?

12)Is HTML page a web component?

13)What is the container?

14)What is the web container?

15)What is the thin client?

16)What are types of J2EE clients?

17)What is deployment descriptor?

18)What is the EAR file?

19)What are JTA and JTS?

20)What is JAXP?

21)What is J2EE Connector?

22)What is JAAP?

23)What is Model 1?

24)What is Model 2?

25)What is Struts?

26)How is the MVC design pattern used in Struts framework?

27)Do you have to use design pattern in J2EE project?

28)Is J2EE a super set of J2SE?

29)What does web module contain?

30)What APIs are available for developing a J2EE application?



J2EE Tutorial-An Introduction


The Java language is such that it allows cross-platform communication between multiple kinds of devices. For example, a programmer can develop Java code on a desktop computer and expect it to run on other computers, routers, and even mobile phones, as long as those devices are Java-enabled. This portability is described by the Sun acronym WORA, which stands for "Write once, run anywhere." A large number of mainframes, computers, mobile phones, and other electronic devices operate using the Java Platform.
The 2 in the acronym J2EE stands for Version 2. As with many software applications, J2EE is Java Platform Version 2. Actually, the number 2 is often dropped nowadays, so J2EE becomes Java EE. Traditionally, though, it's still J2EE.
Now, on to the EE. It stands for Enterprise Edition, which is a powerful form of the Java Platform. Sun has created three editions so far. The most precise is the Micro Edition, which is used for mobile phones and PDAs. Following form, this can be abbreviated as Java ME.
The middle edition is the Standard Edition, which can run on mobile devices, laptops and desktop computers. The abbreviated name of this edition is Java SE. Building our way up the pyramid, we come at last to the Enterprise Edition, which includes all the functionality of the Micro Edition and the Standard Edition and also features routines and subroutines designed specifically for servers and mainframes.