Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

The following two rules are defined by? 1. The parameters may differ in their type or number, or in both. 2. They may have the same or different return types.

A. Method overloading
B. Method overriding
C. Constructor overloading
D. None of the above
Answer» B. Method overriding
2.

In Method overriding a subclass in a different package can only override the non-final methods declared public or protected

A. True
B. False
Answer» B. False
3.

Which allows you to define one interface and have multiple implementations?

A. Encapsulation
B. Inheritance
C. Polymorphism
D. None of the above
Answer» D. None of the above
4.

Which is used for writing data to a file in file handling?

A. FileInputStream
B. FileOutputStream
C. Both A & B
D. None of the above
Answer» C. Both A & B
5.

In which state is the thread after invocation of start() method, but the thread Scheduler has not selected it to be the running thread?

A. Running
B. Runnable
C. Terminated
D. Non-Runnable
Answer» C. Terminated
6.

Which one of the following scopes does the attribute in servlet is an object that can be set, get or removed?

A. session scope
B. request scope
C. application scope
D. All mentioned above
Answer» E.
7.

Constructor does not perform other tasks instead of initialization

A. True
B. False
Answer» C.
8.

Which package is used for analyzing code during run time?

A. java.lang.reflect
B. java.awt
C. java.io
D. java.applet
Answer» B. java.awt
9.

The JDK forms an extended subset of a software development kit (SDK)

A. True
B. False
Answer» B. False
10.

Which mechanism is provided to handle the runtime errors so that normal flow of the application can be maintained?

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

Datagram is basically an information but there is no guarantee of its content, arrival or arrival time.

A. True
B. False
Answer» B. False
12.

Which Characters are illegal in XML elements?

A. " < "
B. "&"
C. Both A & B
D. None of the above
Answer» D. None of the above
13.

Which middleware services are provided by EJB?

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

In RMI which layer defines and supports the invocation semantics of the RMI connection and this layer maintains the session during the method call?

A. The Stub & Skeleton Layer
B. The Application Layer
C. The Remote Reference Layer
D. The Transport Layer
Answer» D. The Transport Layer
15.

A JSP page consists of which tags?

A. HTML tags
B. JSP tags
C. Both A & B
D. None of the above
Answer» D. None of the above
16.

The JDBC API is what allows access to a data source from a Java middle tier

A. True
B. False
Answer» B. False
17.

Many threads at a time can run in a single process

A. True
B. False
Answer» C.
18.

The CharArrayWriter class is not used to write data to multiple files

A. True
B. False
Answer» C.
19.

Which data type has this Minimum and Maximum value from 3.4e-038 to 3.4e+038?

A. long
B. Int
C. Byte
D. Float
Answer» E.
20.

Which containers are used to keep the class name space compartmentalized?

A. Packages
B. Applet
C. Browser
D. None of the above
Answer» B. Applet
21.

How many core components does the Model-View-Controller pattern in Struts2 have?

A. 4
B. 5
C. 6
D. 3
Answer» C. 6
22.

Which are the examples of Application Server?

A. Apache
B. Tomcat
C. JBoss
D. Weblogic
E. Both C & D
Answer» F.
23.

XML is designed to store data and _____.

A. Design
B. Verify
C. Transport
D. Both A & B
Answer» D. Both A & B
24.

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» B. Session Bean
25.

The Following steps are required to perform (1) Implement the Listener interface and overrides its methods (2) Register the component with the Listener

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

Which are the XML Syntax rules?

A. All XML Elements Must Have a Closing Tag
B. XML Tags are not Case Sensitive
C. XML Elements Must be Properly Nested
D. Both A & C
Answer» E.
27.

XML documents must contain a root element; this element is "the parent" of all other elements

A. True
B. False
Answer» B. False
28.

The URLConnection class can be used to read and write data to the specified resource referred by the URL

A. True
B. False
Answer» B. False
29.

The client in socket programming must know which informations?

A. IPaddress of Server
B. Port number
C. Both A & B
D. None of the above
Answer» D. None of the above
30.

Which type of java package that contains wide range of classes and methods are used for performing different functionalities?

A. User Defined Package
B. Java System Packages
C. User System Packages
D. None of the above
Answer» C. User System Packages
31.

Find whether these two rules are correct or not defined by the constructor 1. Constructor name must be same as its class name. 2. Constructor must have no explicit return type.

A. True
B. False
Answer» B. False
32.

Which driver converts JDBC calls directly into the vendor-specific database protocol?

A. Native - API driver
B. Network Protocol driver
C. Thin driver
D. Both B & C
Answer» D. Both B & C
33.

Which are also known as inner classes?

A. Non-static nested class
B. Static nested class
C. Nested class
D. None of the above
Answer» B. Static nested class
34.

Which classes are used for connection-less socket programming?

A. DatagramSocket
B. DatagramPacket
C. Both A & B
D. None of the above
Answer» D. None of the above
35.

When an applet begins, in which sequence will the AWT call the methods?

A. init(),paint(),start()
B. Start(),paint(),init()
C. intit(),start(),paint()
D. paint(),start(),init()
Answer» D. paint(),start(),init()
36.

Void is not a wrapper class

A. True
B. False
Answer» B. False
37.

Package does not provide access protection

A. True
B. False
Answer» C.
38.

Which type of polymorphism is nothing but the method overloading in java?

A. Compile time polymorphism
B. Runtime polymorphism
C. Static polymorphism
D. Both A & C
Answer» E.
39.

Which class can be used to read data line by line using the readLine() method?

A. BufferedReader
B. InputStreamReader
C. DataInputStream
D. None of the above
Answer» B. InputStreamReader
40.

Which is nothing but a blueprint or a template for creating different objects which defines its properties and behaviours?

A. An Array
B. A class
C. Interface
D. None of the above
Answer» C. Interface
41.

XML is the most common tool for data transmissions between all sorts of applications

A. True
B. False
Answer» B. False
42.

Generally string is a sequence of characters, But in java, string is an _______.

A. Object
B. Class
C. Package
D. None of the above
Answer» B. Class
43.

Which block contains a block of program statements where an exception might occur?

A. Catch
B. try
C. throw
D. final
Answer» C. throw
44.

In JSP how many ways are there to perform exception handling?

A. 3
B. 2
C. 4
D. 5
Answer» C. 4
45.

Which JDBC drivers will run your program?

A. The JDBC-ODBC bridge
B. The JDBC driver manager
C. The JDBC driver test suite
D. None of the above
Answer» D. None of the above
46.

Which package provides core functionality?

A. java.net
B. java.rmi
C. java.lang
D. java.math
Answer» D. java.math
47.

Which is a software- and hardware-independent tool for carrying information?

A. HTML
B. XML
C. Both A & B
D. None of the above
Answer» C. Both A & B
48.

Which class is used to create servers that listen for either local client or remote client programs?

A. ServerSockets
B. httpServer
C. httpResponse
D. None of the above
Answer» B. httpServer
49.

Which method is used to suspend threads that don’t need to run when the applet is not visible?

A. destroy()
B. paint()
C. stop()
D. start()
Answer» D. start()
50.

Which internet language is used for describing available web services in XML?

A. WSDL
B. RSS
C. RDF
D. OWL
Answer» B. RSS