81
87.5k

100+ J2EE Technologies Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Master of Computer Applications (MCA) .

1.

It is lightweight.It supports pluggable look and feel.It follows MVC (Model View Controller) architecture. The following specifies the advantages of

A. Swing
B. AWT
C. Both A & B
D. None of the above
Answer» A. Swing
2.

Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?

A. True
B. False
C. none
D. all
Answer» A. True
3.

Which class provides many methods for graphics programming?

A. java.awt
B. java.Graphics
C. java.awt.Graphics
D. None of the above
Answer» C. java.awt.Graphics
4.

Implement the Listener interface and overrides its methods. Register the component with the Listener The Following steps are required to perform

A. Exception Handling
B. String Handling
C. Event Handling
D. None of the above
Answer» C. Event Handling
5.

The ActionListener interface is not used for handling action events?

A. True
B. False
C. none
D. all
Answer» B. False
6.

The ActionListener interface is used for handling action events,Forexample,it's used by a

A. JButton
B. JCheckbox
C. JMenuItem
D. All of these
Answer» D. All of these
7.

JFramemyFrame = new JFrame (); Any command (such as the one listed above) which creates a new object of a specific class (in this case a new JFrame object called myFrame) is generally called a ...

A. Constructor
B. Layout manager
C. Parameter
D. GUI
Answer» A. Constructor
8.

MVC Architecture stands for

A. . Model View Controller
B. . Mode View Control
C. . Maximum View Control
D. . None
Answer» A. . Model View Controller
9.

Which is the container that doesn't contain title bar and MenuBars but it can have other components like button, textfieldetc?

A. Window
B. Frame
C. Panel
D. all the above
Answer» C. Panel
10.

Which is the passive control that do not support any interaction with the user?

A. JList
B. JLabel
C. JTable
D. JTree
Answer» B. JLabel
11.

. Component used for displaying data in tabular

A. JList
B. JTextArea
C. JTable
D. JTree
Answer» C. JTable
12.

Java Bean is a _____________ technology

A. Component
B. scripting
C. middle tier
D. None
Answer» A. Component
13.

Manifest file is a special file that contains information about the files packed in

A. JAR file
B. GIF
C. JPEG
D. all the above
Answer» A. JAR file
14.

Which of the following is not true about Java beans?

A. Implements java.io.Serializable interface
B. Extends java.io.Serializable class
C. Provides no argument constructor
D. Provides setter and getter methods for its properties
Answer» B. Extends java.io.Serializable class
15.

Which file separator should be used by MANIFEST file?

A. /
B. \
C.
D. //
Answer» A. /
16.

Which of the following is correct error when loading JAR file with duplicate name?

A. java.io.NullPointerException
B. java.lang.ClassNotFound
C. java.lang.ClassFormatError
D. java.lang.DuplicateClassError
Answer» C. java.lang.ClassFormatError
17.

Java Beans are extremely secured?

A. True
B. False
C. none
D. all
Answer» B. False
18.

Which of the following is not a feature of Beans?

A. Introspection
B. Events
C. Persistence
D. Serialization
Answer» D. Serialization
19.

Which services are provided to EJB components by the EJB container?

A. Transaction support
B. Persistence support
C. Naming support
D. All mentioned above
Answer» D. All mentioned above
20.

Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?

A. Bean-managed transactions
B. Container-managed transactions
C. Both A & B
D. None of the above
Answer» A. Bean-managed transactions
21.

EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.

A. True
B. False
C. none
D. all
Answer» A. True
22.

A message driven bean is like a stateful session bean that encapsulates the business logic and doesn't maintain state.

A. True
B. False
C. none
D. all
Answer» B. False
23.

Abbreviate the term JMS?

A. Java Message Service
B. Java Monitor Service
C. Java Message Session
D. Java Monitor Session
Answer» A. Java Message Service
24.

JMS is mainly used to send and receive message from one application to another.

A. True
B. False
C. none
D. all
Answer» A. True
25.

Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns?

A. Stateful Session Bean
B. Stateless Session Bean
C. Singleton Session Bean
D. None of the above
Answer» C. Singleton Session Bean
26.

Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?

A. Transaction support
B. Persistence support
C. Naming support
D. All mentioned above
Answer» C. Naming support
27.

EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.

A. True
B. False
C. none
D. all
Answer» A. True
28.

A session bean represents a multiple clients inside the Application Server.

A. True
B. False
C. none
D. all
Answer» B. False
29.

Which component does the Entity bean represent the persistent data stored in the database?

A. Server-side component
B. Client-side component
C. server and client side component
D. None of the above
Answer» A. Server-side component
30.

EJB is like COM, Abbreviate the term COM?

A. Component Object Model
B. Component Oriented Model
C. Common Object Model
D. Common Oriented Model
Answer» A. Component Object Model
31.

JMS is also known as a messaging service.

A. True
B. False
C. none
D. all
Answer» A. True
32.

What represents a persistent global data from the database?

A. Entity Bean
B. Session Bean
C. Both A & B
D. None of the above
Answer» A. Entity Bean
33.

Which component does the Entity bean represents the persistent data stored in the database?

A. Server-side component
B. Client-side component
C. server and client side component
D. None of the above
Answer» A. Server-side component
34.

In EJB, middleware services are provided by EJB Container automatically.

A. True
B. False
C. none
D. all
Answer» A. True
35.

Which middleware services are provided by EJB?

A. Security
B. Transaction Management
C. Both A & B
D. None of the above
Answer» C. Both A & B
36.

Which server-side component is required to be deployed on the server?

A. EJB
B. RMI
C. Both A & B
D. None of the above
Answer» A. EJB
37.

Which type of instances retain no data or conversational state for a specific client?

A. Message-Driven Bean
B. Session Bean
C. Entity Bean
D. None of the above
Answer» A. Message-Driven Bean
38.

EJB technology is built on the top of Socket Programming

A. True
B. False
C. none
D. all
Answer» B. False
39.

How constructor can be used for a servlet?

A. Initialization
B. Constructor function
C. Initialization and Constructor function
D. Setup() method
Answer» C. Initialization and Constructor function
40.

Can servlet class declare constructor with ServletConfig object as an argument?

A. True
B. False
C. none
D. all
Answer» B. False
41.

Java Servletsare efficient and powerful solution for creating .......................for the web.

A. dynamic content
B. static content
C. hardware
D. both and b
Answer» A. dynamic content
42.

..................... is the first phase of the servlet life cycle.

A. Initialization
B. Service
C. Destruction
D. Both a and b
Answer» A. Initialization
43.

The service phase of the servlet life cycle represents all interactions with requests until the servlet is ......................

A. created
B. running
C. initiated
D. destroyed
Answer» D. destroyed
44.

GET methods are great for sending ....................amounts of information that you do not mind having visible in a URL.

A. negligible
B. huge
C. small
D. both and b
Answer» C. small
45.

Several vendors are adding ...................... to their existing database .................

A. JDOBC, middle-ware products
B. JDBC drivers, upper-ware products
C. middle-ware products, JDOBC drivers
D. JDBC drivers, middle-ware products
Answer» D. JDBC drivers, middle-ware products
46.

Which of the following code is used to get an attribute in a HTTP Session object in servlets?

A. session.getAttribute(String name)
B. session.alterAttribute(String name)
C. session.updateAttribute(String name)
D. session.setAttribute(String name)
Answer» A. session.getAttribute(String name)
47.

A servlet needs to acquire a data source through a JNDI naming lookup. Which of the following is the best place to do this?

A. Constructor
B. init method
C. service method
D. doGet method
Answer» B. init method
48.

What's the difference between servlets and applets? a. Servlets executes on Servers, where as

A. Applets executes on Browser
B. Servlets have no GUI, where as an Applet has GUI
C. Servlets creates static web pages, where as Applets creates dynamic web pages
D. Servlets can handle only a single request, where as Applet can handle multiple requests
Answer» A. Applets executes on Browser
49.

Which of the following code retrieves the body of the request as binary data?

A. DataInputStream data = new InputStream()
B. DataInputStream data = response.getInputStream()
C. DataInputStream data = request.getInputStream()
D. DataInputStream data = request.fetchInputStream()
Answer» C. DataInputStream data = request.getInputStream()
50.

When destroy() method of a filter is called?

A. The destroy() method is called only once at the end of the life cycle of a filter
B. The destroy() method is called after the filter has executed doFilter method
C. The destroy() method is called only once at the begining of the life cycle of a filter
D. The destroyer() method is called after the filter has executed
Answer» A. The destroy() method is called only once at the end of the life cycle of a filter

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.