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.

Implement the Listener interface and overrides its methods is required to perform in event handling.

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

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

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

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
4.

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

A. True
B. False
Answer» B. False
5.

If the superclass method does not declare an exception, subclass overridden method cannot declare the checked exception but it can declare unchecked exception.

A. True
B. False
Answer» B. False
6.

If a subclass has the same method as declared in the parent class it is known as ______.

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

If a class has multiple methods by same name but different parameters, it is known as?

A. Constructor overloading
B. Method overloading
C. Operator overloading
D. None of these
Answer» C. Operator overloading
8.

How many ways are there to access package from another package?

A. 3
B. 2
C. 1
D. 5
Answer» B. 2
9.

How many types of session beans are available in EJB?

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

How many types of controls does AWT support?

A. 7
B. 6
C. 5
D. 8
Answer» B. 6
11.

How many types of constructor are defined in the StringTokenizer class?

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

How many steps are used to connect any java application using JDBC?

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

How many reserved keywords are currently defined in the Java language?

A. 48
B. 49
C. 50
D. 47
Answer» C. 50
14.

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

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

How many layers are available in Hibernate architecture?

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

How many jsp implicit objects are there and these objects are created by the web container that are available to all the jsp pages?

A. 8
B. 9
C. 10
D. 7
Answer» C. 10
17.

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

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

Hibernate is an?

A. Open Source
B. Lightweight
C. ORM
D. All mentioned above
Answer» E.
19.

Hibernate framework simplifies the development of java application to interact with the database

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

Hibernate caching improves the performance of the application by pooling the object in the cache.

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

Give the abbreviation of AWT?

A. Applet Windowing Toolkit
B. Abstract Windowing Toolkit
C. Absolute Windowing Toolkit
D. None of the above
Answer» C. Absolute Windowing Toolkit
22.

Give the abbrevation of BSD.

A. Berkeley Software Distribution
B. Berkeley Socket Distribution
C. Berkeley System Distribution
D. None of the above
Answer» B. Berkeley Socket Distribution
23.

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
24.

Garbage collection only occurs sporadically during the execution of your program

A. True
B. False
Answer» B. False
25.

Garbage Collection is the process of reclaiming the runtime unused memory automatically.

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

From where the SequenceInputStream class is used to read data?

A. Single Stream
B. Multiple streams
C. Multilevel Streams
D. None of the above
Answer» C. Multilevel Streams
27.

From the following statements which is a disadvantage of an java array?

A. An array can hold primitive types data
B. An array has its size that is known as array length
C. An array knows only its type that it contains. Array type is checked at the compile-time
D. An array holds only one type of data
Answer» E.
28.

From the following statements which is a drawback for Applet?

A. It works at client side so less response time
B. Secured
C. It can be executed by browsers running under many platforms, including Linux, Windows, and Mac Os etc.
D. Plugin is required at client browser to execute applet
Answer» E.
29.

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
30.

Find the correct syntax of the declaration which defines the XML Version?

A. < ?xml version= "1.0" ? >
B. < xml version="1.0"/ >
C. < ?xml version="1.0" / >
D. None of the above
Answer» B. < xml version="1.0"/ >
31.

Filtered streams are simply wrappers around underlying input or output streams that transparently provide some extended level of functionality.

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

Exception Handling is a mechanism to handle runtime errors

A. True
B. False
Answer» B. False
33.

Drivers that are JDBC Compliant should normally support scrollable result sets, but they are not required to do so.

A. True
B. False
Answer» B. False
34.

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

A. True
B. False
Answer» B. False
35.

Daemon thread provides services to user threads for background supporting tasks,It has no role in life than to serve user threads.

A. True
B. False
Answer» B. False
36.

Constructor is like a method that is used to initialize the state of an object. It is invoked at the time of object creation

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

Constructor does not perform other tasks instead of initialization

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

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
39.

Connection Pooling Class manages no of user requests for connections to improve the performance.

A. True
B. False
Answer» B. False
40.

Classes in the same package cannot access each other's package-access members.

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

Can we start a thread twice?

A. Yes
B. No
Answer» C.
42.

By overriding the toString() method of the Object class, we can return values of the object, so we don't need to write much code.

A. True
B. False
Answer» B. False
43.

By interface, we cannot support the functionality of multiple inheritances.

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

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

A. True
B. False
Answer» B. False
45.

Both threads are waiting for each other to release the lock, the condition is called deadlock.

A. True
B. False
Answer» B. False
46.

AWT is used for GUI programming in java

A. True
B. False
Answer» B. False
47.

AWT has more powerful components like tables, lists, scroll panes, color chooser, tabbed pane etc.

A. True
B. False
Answer» B. False
48.

Applets cannot make network connection exception to the server host from which it originated.

A. True
B. False
Answer» B. False
49.

Applet runs inside the browser and works at client side

A. True
B. False
Answer» B. False
50.

Applet runs inside the browser and does not works at client side.

A. True
B. False
Answer» C.