Basic Java Multiple Choice Questions with Answers - 2

Question: 6

Which of the following are J2EE modules?

(A) EJB, Web, Application client and Java servlet

(B) EJB, Web, Application client and Resource adapter

(C) EJB, Web, Applet and Resource adapter

(D) EJB, Web, Application client and Applet

Ans: B

EJB, Web, Application client and Resource adapter

Question: 7

Which of the following should NOT be used to share data between servlets in a distributed web application?

(A) Attributes of ServletContext

(B) Enterprise Java Beans

(C) Attributes of HttpSession

(D) Database

Ans: A

Attributes of ServletContext

Question: 8

Which of the following statement is true?

(A) J2EE component is a self contained functional software unit supported by a container

(B) J2EE applications modules cannot be deployed as standalone units

(C) Modules cannot be assembled into J2EE applications

(D) J2EE components are written in the C programming language

Ans: A

J2EE component is a self contained functional software unit supported by a container

Question: 9

Which of the following is NOT an advantage of using the SessionFacade pattern?

(A) Hides model complexity from the client

(B) Reduces network traffic

(C) Provides a simple interface to the client

(D) Enables the client to control transactions

Ans: D

Enables the client to control transactions

Question: 10

JDBC driver is loaded by calling which of the following methods

(A) call() method

(B) class.forName () methods

(C) close () method

(D) connect () methods

Ans: B

class.forName () methods

Related Questions