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.

Built-in multiway decision statement in Java is known as

A. Switch
B. Oprator
C. Break
D. Continue
Answer» B. Oprator
2.

One if or else if statement inside another if or else if statement is

A. if statement
B. if-else statement
C. if-else-if ladder
D. nested if statement
Answer» E.
3.

Which one will returns the absolute value of a

A. rint(a)
B. log(a)
C. abs(a)
D. exp(a)
Answer» D. exp(a)
4.

What is the action of rint() in Java

A. Returns the absolute value of the argument
B. Returns the smallest of the two arguments
C. Returns the double value that is closest in value to the argument
D. Returns the largest integer that is less than or equal to the argument
Answer» D. Returns the largest integer that is less than or equal to the argument
5.

Which one returns the smallest whole number greater than or equal to x is

A. rint(x)
B. sqrt(x)
C. log(x)
D. ceil(x)
Answer» E.
6.

Unary minus ‘-‘ has associativity from

A. Right to left
B. Left to right
C. Not associative
D. None of the above
Answer» B. Left to right
7.

When a=9, b=12, c=3 then output of following statement is: x = a-b/3+c*2-1

A. 8
B. 10
C. 12
D. 15
Answer» C. 12
8.

Which of the following operator has higher precedence

A. +
B. -
C. *
D. ||
Answer» D. ||
9.

The operator sign ‘|’ is used for Bitwise __

A. AND
B. OR
C. XOR
D. Complement
Answer» C. XOR
10.

Java has a distinction of supporting special operators known as

A. Bitwise operators
B. Unary Operators
C. Conditional Operators
D. Type Comparison Operator
Answer» B. Unary Operators
11.

Arithmetic operators in java can not be applied to

A. Long
B. Char
C. Float
D. Boolean
Answer» E.
12.

Which of the variables serve as symbolic constants

A. Boolean
B. Char
C. Float
D. Final
Answer» E.
13.

What are typically used to store information in Java

A. Variables
B. Constant
C. Conversion
D. None of the above
Answer» B. Constant
14.

What is the default value of boolean in java

A. True
B. False
C. Null
D. 0.0d
Answer» C. Null
15.

What is the default value of int

A. 0.0F
B. 0L
C. 0
D. 1
Answer» D. 1
16.

Assigning a larger type to a smaller one is known as __ conversion in Java

A. Identity
B. Narrowing
C. Boxing
D. Capture
Answer» C. Boxing
17.

Which type of conversions do not lose information about the magnitude of a value

A. String
B. Capture
C. Narrowing
D. Widening
Answer» E.
18.

The syntax "type variable = (type) variable2" is used for

A. Type casting
B. Type compression
C. Type inheritance
D. Type correction
Answer» B. Type compression
19.

Assigning a value of one type to a variable of another type is known as

A. Type compression
B. Type casting
C. Type correction
D. Type inheritance
Answer» C. Type correction
20.

Which of the following is derived data type

A. Floating point
B. Interface
C. Character
D. Boolean
Answer» C. Character
21.

For logical value, which primitive type is used

A. Float
B. Long
C. Double
D. Boolean
Answer» E.
22.

Which of the following is intrinsic data type

A. Classes
B. Arrays
C. Integer
D. Interface
Answer» D. Interface
23.

Approximate range of double is

A. 4.9e–324 to 1.8e+308
B. 1.4e-045 to 3.4e+038
C. -2147483648 to + 2147483647
D. 0 to 65535
Answer» B. 1.4e-045 to 3.4e+038
24.

For storing a value, double uses

A. 24 bit
B. 32 bit
C. 64 bit
D. 128 bit
Answer» D. 128 bit
25.

The range of floating point is

A. -128 to +127
B. 1.4e–045 to 3.4e+038
C. -2147483648 to + 2147483647
D. -32768 to + 32767
Answer» C. -2147483648 to + 2147483647
26.

Float has __ bits of storage

A. 16
B. 32
C. 64
D. 128
Answer» C. 64
27.

A Signed 64-bit type is named as

A. Byte
B. Short
C. Int
D. Long
Answer» E.
28.

The range of Short is

A. –27,568 to 27,567
B. –30,453 to 30,453
C. –32,768 to 32,767
D. –34,563 to 34,563
Answer» D. –34,563 to 34,563
29.

Which one loop is also known as Entry Control loop

A. Infinite loop
B. Do while loop
C. For loop
D. While loop
Answer» E.
30.

Exit for loop is an example of

A. Do while loop
B. While loop
C. For loop
D. None of the above
Answer» B. While loop
31.

A loop in java ends with

A. Colon
B. Semicolon
C. Dot
D. Slash
Answer» C. Dot
32.

Which one is a correct if statement

A. if{condition} (statement)
B. if condition {statement}
C. if(condition) {statement}
D. if{condition} statement
Answer» D. if{condition} statement
33.

The protected access modifier can be applied on

A. Members
B. Class
C. Method
D. Interface
Answer» B. Class
34.

The protected access modifier is accessible within package and outside the package but through __ only

A. Encasulation
B. Abstraction
C. Inheritance
D. Polymorphism
Answer» D. Polymorphism
35.

Access modifier which is accessible only within class is called

A. Private
B. Default
C. Protected
D. Public
Answer» B. Default
36.

Which one is not a java access modifiers

A. Private
B. Default
C. Protected
D. Abstract
Answer» E.
37.

Which of the following is a single line comment syntax

A. / comment
B. // comment
C. /* comment */
D. //* comment */
Answer» C. /* comment */
38.

Which of the following is a multi line comment syntax

A. begin with / and end with /
B. begin with /* and end with */
C. begin with # and end with #
D. begin with /@ and end with @/
Answer» C. begin with # and end with #
39.

HotJava Browser was developed in the year

A. 1990
B. 1992
C. 1995
D. 1996
Answer» D. 1996
40.

Which one is not a Java Comment type

A. Single line comment
B. Two line comment
C. Multi line comment
D. Documentation comment
Answer» C. Multi line comment
41.

Which one was the first browser to support Java applets

A. Internet Explorer
B. Safari
C. HotJava
D. NetJava
Answer» D. NetJava
42.

Static binding calls at

A. Start time
B. Compile time
C. Process time
D. Execution time
Answer» C. Process time
43.

Dynamic binding calls at

A. Start time
B. Compile time
C. Run time
D. Execution time
Answer» D. Execution time
44.

Name of the process by which objects of one class acquire the properties of objects of another is called

A. Information Hiding
B. Inheritance
C. Polymorphism
D. Encapsulation
Answer» C. Polymorphism
45.

The act of representing essential features without including the background details or explanations is called

A. Abstraction
B. Polymorphism
C. Encapsulation
D. Inheritance
Answer» B. Polymorphism
46.

Java is a __

A. Logic-based language
B. Stack-based language
C. Data-structured language
D. Object oriented programming language
Answer» E.
47.

Which one is commonly used to extend the applications hosted by web servers

A. JSP
B. IDE
C. Applet
D. Servlet
Answer» E.
48.

A highly optimized set of instructions designed to be executed by the Java run-time system, is called

A. Objectcode
B. Bitcode
C. Bytecode
D. Floatcode
Answer» D. Floatcode
49.

Java is a

A. Static language
B. Dynamic language
C. Assembly language
D. Binary language
Answer» C. Assembly language
50.

A special kind of Java program that is designed to be transmitted over the Internet and automatically executed by a Java-compatible web browser is

A. Servlets
B. JSP
C. Applet
D. Bytecode
Answer» D. Bytecode