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.

A final class is not to be inherited.

A. True
B. False
Answer» B. False
2.

What is meant by JIT?

A. Java In Time
B. Just In Time
C. Join In Time
D. None of the above
Answer» C. Join In Time
3.

If there is no constructor in a class, compiler automatically creates a default constructor.

A. True
B. False
Answer» B. False
4.

Which method is used to invoke the garbage collector to perform the cleanup processing?

A. gc() method
B. finalize() method
C. q.get() method
D. None of the above
Answer» B. finalize() method
5.

In the following JDBC drivers which is known as fully java driver?

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

Which model does a Java applet or application talks directly to the data source?

A. Two-tier models
B. Three-tier models
C. Both A & B
D. None of the above
Answer» B. Three-tier models
7.

Wrapper classes are not used to convert any data type into an object.

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

Which package provides many event classes and Listener interfaces for event handling?

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

Which symbol is used to contain the values of automatically initialized arrays. Also used to define a block of code, for classes, methods, and local scopes?

A. Brackets
B. Braces
C. Parentheses
D. Semicolon
Answer» C. Parentheses
10.

Which method of URL class represents a URL and it has complete set of methods to manipulate URL in Java?

A. java.net.URL
B. java.net.URLConnection
C. Both A & B
D. None of the above
Answer» B. java.net.URLConnection
11.

An interface is a blueprint of a class. It has static constants and abstract methods.

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

Which classes has Sun Microsystem suggested not to use for read and write the textual information?

A. BufferedInputStream and BufferedOutputStream
B. SequenceInputStream and SequenceOutputStream
C. FileInputStream and FileOutputStream
D. Both A & B
Answer» D. Both A & B
13.

Which are the techniques for defining the structure of a specific type of XML documents?

A. Schema
B. DTD
C. Both A & B
D. None of the above
Answer» D. None of the above
14.

What is the advantage of Method Overloading?

A. Method overloading increases the readability of the program
B. Method overloading does not increases the readability of the program
C. Method overloading does not increases the reliability of the program
D. None of the above
Answer» B. Method overloading does not increases the readability of the program
15.

The values configured in struts.properties file will override the default values configured in default.properties which is contained in the struts2-core-x.y.z.jar distribution.

A. True
B. False
Answer» B. False
16.

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

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

1099 is the default port used by RMI Registry.

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

Which tag is used to execute java source code in JSP?

A. Declaration Tag
B. Scriptlet tag
C. Expression tag
D. None of the above
Answer» C. Expression tag
19.

Java Plug-in software is not responsible to manage the lifecycle of an Applet.

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

XML is a programming language like C# or Java.

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

Which provides a new way for your programs to interface with code libraries written in other languages?

A. JNI
B. JDBC
C. RMI
D. GUI
Answer» B. JDBC
22.

An abstract class has no use when it is extended by some other class.

A. True
B. False
Answer» B. False
23.

Which method of 'Class' class is used to register the driver class and the method is used to dynamically load the driver class?

A. forName()
B. getConnection()
C. createStatement()
D. executeQuery()
Answer» B. getConnection()
24.

A class is declared inside a class but outside a method it is known as ________.

A. Anonymous Inner class
B. Member Inner class
C. Local Inner class
D. Static nested class
Answer» C. Local Inner class
25.

We need to specify @Inheritance(strategy=InheritanceType.JOINED) in the parent class and @PrimaryKeyJoinColumn annotation in the subclasses.

A. True
B. False
Answer» B. False
26.

Which object is created by the web container at time of deploying the project?

A. ServletConfig
B. ServletContext
C. Both A & B
D. None of the above
Answer» C. Both A & B
27.

Interceptor can change the flow of the application by returning the string.

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

Which way will the architecture and flow of struts 2 application will go to understand the struts flow?

A. Basic
B. Standard
C. Both A & B
D. None of the above
Answer» D. None of the above
29.

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» B. Component Oriented Model
30.

The following a) It is lightweight. b) It supports pluggable look and feel. c) It follows MVC (Model View Controller) architecture are the advantages of _____ .

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

Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed?

A. Local variables
B. Instance variables
C. Class Variables
D. Static variables
Answer» C. Class Variables
32.

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» B. Client-side component
33.

Which ways are used by the Log4j and Logback frameworks in hibernate framework to support logging?

A. By log4j.xml file
B. By log4j.properties
C. Both A & B
D. None of the above
Answer» D. None of the above
34.

If you are inserting any value in the wrong index as shown below, 1. int a[]=new int[5]; 2. a[10]=50; it would result in ______.

A. NullPointerException
B. ArrayIndexOutOfBoundsException
C. ArithmeticException
D. NumberFormatException
Answer» C. ArithmeticException
35.

Which are passive controls that do not support any interaction with the user?

A. Choice
B. List
C. Labels
D. Checkbox
Answer» D. Checkbox
36.

Which access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?

A. Private
B. Public
C. Protected
D. None of the above
Answer» C. Protected
37.

Breaking a string or stream into meaningful independent words is known as tokenization.

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

What can be accessed or inherited without actual copy of code to each program?

A. Browser
B. Applet
C. Package
D. None of the above
Answer» D. None of the above
39.

What is used to display the intermediate result in an interceptor?

A. Params Interceptor
B. Custom Interceptor
C. ExecAndWait Interceptor
D. Prepare Interceptor
Answer» D. Prepare Interceptor
40.

Which Thread pool is used where container creates a thread pool to process the request?

A. Servlet
B. JSp
C. All of the above
D. None of the above
Answer» D. None of the above
41.

The workflow interceptor is used to get information about the error messages defined in the action class.

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

How many methods does a thread class provides for sleeping a thread?

A. 3
B. 1
C. 4
D. 2
Answer» E.
43.

If you import a package, subpackages will not be imported.

A. True
B. False
Answer» B. False
44.

Which method returns a reference to the currently executing thread object?

A. currentThread()
B. runningThread()
C. runnableThread()
D. None of the above
Answer» B. runningThread()
45.

Which keyword is used to make the classes and interface of another package accessible to the current package?

A. Import
B. Implements
C. Instanceof
D. None of the above
Answer» B. Implements
46.

Which is a language for finding information in an XML document?

A. Xpath
B. XSLT
C. XLink
D. XPointer
Answer» B. XSLT
47.

Which allows the caller to remove elements from the underlying collection during the iteration with well-defined semantics?

A. Enumeration
B. Iterator
C. None of the above
D. Both A & B
Answer» C. None of the above
48.

Consider the following two statements (A) int x = 25; (B) Integer y = new Integer(33); What is the difference between these two statements?

A. Primitive data types
B. primitive data type and an object of a wrapper class
C. Wrapper class
D. None of the above
Answer» C. Wrapper class
49.

Which are the main features of XML?

A. Text data description
B. Human- and computer-friendly format
C. Handles data in a tree structure having one-and only one-root element
D. All mentioned above
Answer» E.
50.

Which language is Extensible Markup Language (XML) similar?

A. HTML
B. PHP
C. JavaScript
D. Wordpress
Answer» B. PHP