J2EE Technical Programming Interview Questions Part 2

Category > JAVA || Published on : Wednesday, May 13, 2015 || Views: 3426 || j2ee interview questions and answers for experienced j2ee interview questions pdf j2ee interview questions and answers for freshers pdf java j2ee interview questions and answers for experienced pdf


J2EE Technical Programming Interview Questions Part 2

Question 1.) What’s the difference between Thread and Runnable?

Ans: A Java Thread controls the main path of execution in an application. When you invoke the Java Virtual Machine with the java command, it creates an implicit thread in which to execute the main method. The Thread class provides a mechanism for the first thread to start-up other threads to run in parallel with it.

The Runnable interface defines a type of class that can be run by a thread. The only method it requires is run, which makes the interface very easy to fulfil by extending existing classes. A Runnable class may have custom constructors and any number of other methods for configuration and manipulation.

Question 2.) What’s the difference between notify () and notifyAll ()?

Ans:  The notify () is used to unblock one waiting thread; notifyAll () is used to unblock all of them. Using notify () is preferable when only one blocked thread can benefit from the change.notifyAll() is necessary to multiple threads should resume .

Question 3.) The Native API driver:

  1. Translates JDBC calls into a database-independent network protocol that is sent to a middleware server.
  2. Provides JDBC access to databases through ODBC drivers.
  3. Converts JDBC commands into DBMS-specific native calls.
  4. Communicates directly with the vendor’s database.

Ans: 3

Question 4.) Which of the following can be the primary key in the entity bean?

  1. The primary key can be a java primitive type.
  2. The primary key can be Primitive wrapper classes.
  3. None of the above.
  4. Both.

Ans: 2

Question 5.) What are transaction isolation levels in EJB?

  1. Transaction_read_uncommitted
  2. Transaction_read_committed
  3. Transaction_repeatable_read.
  4. Both A and B.
  5. All the three.

Ans: 5

Question 6.) What are the contents of web module?

Ans: A web module contain:

  1. JSP files
  2. Java classes
  3. gif and html files and
  4. web component deployment descriptors

Question 7.) What are the various types of Beans ?

Ans: The various types of beans are

  1. Session Bean
  2. Entity Bean
  3. Message Driven Bean

Question 8.) What are the services provided by a container?

Ans : The Various services provided by container are as follows:

  • Transaction management for the bean
  • Security for the bean
  • Persistence of the bean
  • Remote access to the bean
  • Lifecycle management of the bean
  • Database-connection pooling
  • Instance pooling for the bean