Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 23

Class X

Global IQ Computer Education Centre


8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

1. Who is known as father of Java Programming Language?


a. James Gosling
b. M.P.Java
c. Charles Babbage
d. Blaise Pascal
2. In java control statements break, continue, return, try-catch-finally and assert belongs to?
a. Selection statements
b. Loop statement
c. Transfer statement
d. Pause statement
3. Which provides runtime environment for java byte code to be executed?
a. JDK
b. JVM
c. JRE
d. JAVAC
4. What is byte code in Java?
a. Code generated by a Java compiler
b. Code generated by a Java Virtual Machine
c. Name of Java source code file
d. Block of code written inside a class
5. Which of the following are not Java keywords?
a. double
b. switch
c. then
d. instanceOf
6. What is garbage collection in the context of Java?
a. Java deletes all unused java files on the system.
b. Memory used by the object with no reference is automatically reclaimed.
c. The JVM cleans output of Java program with error.
d. Any unused package in a program automatically gets deleted.
7. Which of these have highest precedence?
a. ( )
b. ++
c. *
d. >>
8. A process that involves recognizing and focusing on the important characteristics of a situation or
object is known as:
a. Encapsulation
b. Polymorphism
c. Abstraction
d. Inheritance
9. Which statement is true regarding an object?
a. An object is what classes instantiated are from
b. An object is an instance of a class
c. An object is a variable
d. An object is a reference to an attribute
10.  In object-oriented programming, new classes can be defined by extending existing classes. This is
an example of:
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

a. Encapsulation
b. Interface
c. Composition
d. Inheritance
11. The wrapping up of data and functions into a single unit is called
a. Encapsulation
b. Interface
c. Composition
d. Inheritance
12. Basic Java language functions are stored in which of the following java package?
a.  java.lang
b. java.io
c. java.net
d. java.util
13. The default value of a static integer variable of a class in Java is,
a. 0
b. 1
c. Garbage value
d. Null
14. What is the type and value of the following expression? (Notice the integer division)
-4 + 1/2 + 2*-3 + 5.0
a. int -5
b. double -4.5
c. int -4
d. double -5.0
15. What is printed by the following statement?
System.out.print(“Hello,\nworld!”);
a. Hello, \nworld!
b. Hello, world!
c. “Hello, \nworld!”
d. None of the above.
16.  Which of the following variable declaration would NOT compile in a java program?
a. int var;
b. int VAR;
c. int var1;
d. int 1_var;
17. What is byte code in the context of Java?
a. The type of code generated by a Java compiler.
b. The type of code generated by a Java Virtual Machine.
c. It is another name for a Java source file.
d. It is the code written within the instance methods of a class.
18. Use the following declaration and initialization to evaluate the Java expressions
int a = 2, b = 3, c = 4, d = 5;
float k = 4.3f;
System.out.println( – -b * a + c *d – -);
a. 21
b. 24
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

c. 28
d. 26
19. Java compiler javac translates Java source code into ………………………
a. Assembler language
b. Byte code
c. Bit code
d. Machine code
20. ……………….. are used to document a program and improve its readability.
a. System cells
b. Keywords
c. Comments
d. Control structures
21. In Java, a character constant’s value is its integer value in the ………………………character set.
a. EBCDIC
b. Unicode
c. ASCII
d. Binary
e. BCD.
22.  In object-oriented programming, the process by which one object acquires the properties of another
object is called
a. Encapsulation
b. Polymorphism
c. Overloading
d. Inheritance
23. Which laboratory was Java invented or developed in?
a. Bell Laboratory
b. Sun Microsystems
c. Dennis Ritchie Office
d. Johnson and Johnson
24. What type of Java Programs can be run inside a Java supported Web Browser?
a. Stand alone
b. Struts
c. Applets
d. AWT
25. What is an Interpreter?
a. An interpreter converts instructions line by line
b. An Interpreter converts source code to low-level code
c. Interpreters are slow to execute
d. All the above
26. What is Compiler?
a. A Compiler converts all instructions in one go.
b. A compiler converts source code to low-level code
c. Compilers work fast
d. All the above
27. What is the file name extension of a Java source program?
a. .J
b. .ja
c. .java
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

d. .jax
28. Byte code is the result of
a. Compiling a Java file
b. Compiling a Class file
c. Interpreting a Java File
d. Interpreting a Class file
29. Which software compiles a Java program?
a. JRE (Java Runtime Environment)
b. JDK (Java Developer Kit)
c. JVM (java Virtual Machine)
d. Command Prompt
30. What is JIT in Java?
a. Java In Timer
b. Java In Time Thread
c. Just In Time Compiler
d. Just In Time Runnable
31. Every statement in Java language should end with a?
a. Dot or period
b. Comma
c. Semicolon
d. Colon
32. What is the need to mention “static” before main method?
a. To call main method without creating an object of class
b. To make main method as class method common to all instances
c. Both A and B
d. None of the above
33. In standalone java application, which method is mandatory?
a. Main method
b. Show method
c. Display method
d. Print method
34. What is the use of Access modifier “public” in Java language?
a. To hide the main method from misuse
b. To call the main method outside of Class or Package by JVM
c. To protect main method
d. None of the above
35. Choose a multiline comment in Java language below?
a. /*comments are going
cars are moving*/
b. */comments are going
cars are moving/*
c. //comments are going
cars are moving//
d. None of the above
36. What is the default return type of a method in Java language?
a. Void
b. int
c. short
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

d. None of these
37. Name of a class, variable, method or an Interface in java language is called?
a. Argument
b. Value
c. Identifier
d. None of these
38. A valid identifier in Java language may contain which characters?
a. 0-9
b. A-Z, a-z
c. $, _(underscore)
d. All of these
39. What are the valid white spaces available in Java language?
a. Space
b. Enter
c. Tab
d. All the above
40. What does a Data type in java refers to?
a. The place where data is stored
b. The technique how data is retrieved
c. The type or variety of data being handled for reading and writing
d. None of the above
41. Choose the number range for byte data type in Java?
a. -127 to +128
b. -128 to +127
c. 0 to 256
d. 0 to 255
42. What is the size of a short integer in Java?
a. 1 byte
b. 2 bytes
c. 4 bytes
d. 8 bytes
43. What is the size of an int integer in Java?
a. 2 bytes
b. 4 bytes
c. 6 bytes
d. 8 bytes
44. What is the size of a long integer in Java?
a. 2 bytes
b. 4 bytes
c. 8 bytes
d. 16 bytes
45. What is the size of a FLOAT floating point number in Java?
a. 2 bytes
b. 4 bytes
c. 6 bytes
d. 8 bytes
46. What is the size of a DOUBLE floating point number in Java?
a. 2 bytes
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. 4 bytes
c. 8 bytes
d. 16 bytes
47. What is the size of a CHAR data type constant in Java?
a. 1 byte
b. 2 bytes
c. 4 bytes
d. 8 bytes
48. What is the size of a boolean data type constant in Java?
a. 1 bit
b. 4 bits
c. 8 bits
d. 16 bits
49. What is the abbreviation of ASCII?
a. American Standard Characters for Information Interchange
b. Australian Standard Code for Information Interchange
c. American Standard Code for Information Interchange
d. None of the above
50. Choose the right statement about Java Data types.
a. Integer data types are short, int and long
b. Real number data types are float and double
c. The character data type is char.
d. All the above
51. An identifiable entity is :
a. Class
b. Object
c. State
d. Behavior
52. An Object consists of : a) state, b) characteristics, c) behavior, d) class
a. Only a
b. Only b
c. Both a and c
d. Both b and d
53. In OOP concept, characteristic does not means
a. Properties
b. States
c. Behaviors
d. Attributes
54. Object Encapsulates
a. Attribute and Behavior
b. State and Attributes
c. Object and Classes
d. None of the above
55. In the following statement, what is “covid19” ? virus covid19=new virus();
a. Class
b. Object
c. Virus
d. Constructor
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

56. Which is not a feature of an OOP?


a. Data hiding
b. Abstraction
c. Polymorphism
d. Procedure
57. The ability of an object to take on many forms, is termed as
a. Encapsulation
b. Object copying
c. Duplication
d. Polymorphism
58. The term ‘base class’ and ‘sub class’ found in the feature of OOP is
a. encapsulation
b. abstraction
c. inheritance
d. polymorphism
59. By which process one class acquires the properties and functionalities of another class
a. Encapsulation
b. Abstraction
c. Inheritance
d. Polymorphism
60. The ‘base class’ is also termed as
a. Super class
b. Derived class
c. Sub class
d. Inherited class
61. The polymorphism supports
a. Pure function
b. Function overriding
c. Function overloading
d. Instance method
62. The act of representing essential features without including background details
a. Encapsulation
b. Abstraction
c. Inheritance
d. Polymorphism
63. The concept ‘data hiding’ is related with
a. Encapsulation
b. Abstraction
c. Inheritance
d. Polymorphism
64. Wrapping up data and function into a single unit is
a. Encapsulation
b. Abstraction
c. Inheritance
d. Polymorphism
65. An object interacts with another, by the
a. String data
b. Input and output
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

c. Parameter
d. Message
66. The blue print of set of objects is:
a. Class
b. Object
c. State
d. Behavior
67. Which is the producer of an object?
a. POP
b. OOP
c. Object
d. Class
68. Which of the following statement is true?
a. Several class can be created from an object
b. Single object can be created from a single class
c. Several objects can be created from a class
d. Single class can be created from a single object.
69. The object is the _____ of a class:
a. Copied form
b. Instance
c. Factory
d. Duplicate
70. The program or code written by a programmer is also called as
a. Byte Code
b. Executable Code
c. Source Code
d. Object Code
71. The Source Code contains
a. Byte Code
b. Java Statement
c. Executable Code
d. ASCII Code
72. Which one is not correct in respect of Byte Code?
a. Byte Code is independent of computer
b. Byte Code is a machine instructions
c. Byte Code Interpreted by Java Compiler
d. It produced after source code compilation
73. It is called “Two Staged Programming” because
a. It is Object Oriented Programming
b. Writing and Executing needs different platform
c. Firstly Source Code produced Object Code, then Executable Code
d. It Compiled then Interpreted
74. Which is not appropriate in respect of JVM?
a. It is a Compiler
b. Full form is Java Virtual Machine
c. It is an Interpreter
d. It creates a virtual environment
75. It is a libraries of compiled codes
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

a. Byte Code
b. API
c. Source Code
d. JVM
76. Two types of java programs are:
a. State and Behavior
b. Class and Object
c. Source Code and Byte Code
d. Internet Applets and Stand Alone Application
77. The full form of WORA is
a. Write Once Run Anywhere
b. Write Over Run Against
c. Work Over Running Environment
d. Write Object Read Any
78. Which one is not the characteristics of Java?
a. Portability
b. WORA
c. Secure Language
d. Procedural Oriented
79. _______ lines are ignored by the compiler
a. Block
b. Comment
c. Outside of class
d. Syntactical Errors
80. What is Literal in Java?
a. Literal is the value that is given or assigned to a variable.
b. Literal is a data type
c. Literal is similar to String
d. None of the above
81. What are the types of Integer Literals in Java?
a. Decimal Literals
b. Octal Literals
c. Hexadecimal Literals
d. All the above
82. How many minimum number of operands are required to use Comparison operators in Java?
a. 1
b. 2
c. 3
d. 4
83. What are the types of data that can be used along with Relational operators in Java?
a. Char, Boolean, object
b. Byte, short, int, long
c. Float, double
d. All the above
84. Which operator group has higher priority between (>, >=, <, <=) and ( = =, !=)?
a. (>, >=, <, <=) has lower priority (==, !=)
b. (>, >=, <, <=) has higher priority (==, !=)
c. (>, >=, <, <=) has equal priority with (==, !=)
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

d. None of the above


85. What is the output of the Java code snippet?
int k=20;
if(k)
{
System.out.println(“Yes”);
}
else
{
System.out.println(“No”);
}

a. No
b. Yes
c. Compiler error
d. None of the above.
86. What is the output of Java code snippet?
int a=5, b=10;
if(++b>10 || a++=5)
{
System.out.println(“PIZZA = “+a);
}
else
{
System.out.println(“BURGER = “+a);
}
a. PIZZA=5
b. PIZZA=6
c. BURGER=5
d. BURGER=6
87. Among Relational operators and Assignment operators, which operators have higher priority?
a. Assignment operators have lower priority than Relational operators
b. Assignment operators have higher priority than Relational operators
c. Assignment operators have equal priority with Relational operators
d. None of the above
88. What is the output of the Java code snippet?
int a=20, b=10;
boolean c = a>=10 && b<20;
System.out.println(c);
a. false
b. true
c. Compiler error
d. None of the above.
89. The condition of a Java Ternary operator should evaluate to _______
a. 1 or 0
b. true or false
c. TRUE or FALSE
d. None
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

90. What is the output of the code snippet with the ternary operator?
int p = 5;
System.out.print(“Hello “);
(p<6) ? 5 : 6;
a. Hello 5
b. Hello 6
c. Hello
d. Compiler error
91. What is the output of the code snippet with the ternary operator?
int num = false ? 10 : 20;
System.out.println(num);
a. 10
b. 20
c. 0
d. Compiler error
92. What is the output of the code snippet with the ternary operator?
String name = “java”;
int marks = name.equals(“java”) ? 10 : 20;
System.out.println(“Marks = “ +marks);
a. Marks = 0
b. Marks = 10
c. Marks = 20
d. Compiler error
93. What is the output of the code snippet with the ternary operator?
String name = “cat”;
int marks = name.equals(“Cat”) ? 10 : 20;
System.out.println(“Marks = “ +marks);
a. Marks = 0
b. Marks = 10
c. Marks = 20
d. Compiler error
94. Which of the following is not a Java features?
a. Dynamic
b. Architecture Neutral
c. Use of pointers
d. Object-oriented
95. The \u0021 article referred to as a
a. Unicode escape sequence
b. Octal escape
c. Hexadecimal
d. Line feed
96. Which of the following is a valid declaration of a char?
a. char ch = '\utea';
b. char ca = 'tea';
c. char cr = \u0223;
d. char cc = '\itea';
97. Which among the following is not a primitive data type in Java?
a. char
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. String
c. byte
d. short
98. How many primitive data types are there in Java?
a. 6
b. 7
c. 8
d. 9
99. In Java byte, short, int and long all of these are
a. Signed
b. Unsigned
c. Both of these
d. None of these
100. Size of int in Java is
a. 16 bit
b. 32 bit
c. 64 bit
d. Depends on execution environment
101. Size of float and double in java is
a. 32 and 64
b. 64 and 64
c. 32 and 32
d. 64 and 32
102. Which of the following automatic type conversion will be possible?
a. Short to int
b. double to int
c. int to long
d. long to int
103. What would be the output of the following fraction code?
int Integer = 34;
char String = ‘S’;
System.out.print ( Integer );
System.out.print ( String );
a. Does not compile as Integer and String are API class name
b. Throws exception
c. 34
d. 34S
104. Which of these is unique entity, contains data and function together in OOP?
a. Class
b. Object
c. Data Abstraction
d. None of these
105. Which of these is OOP language?
a. COBOL
b. java
c. Small Talk
e. Both (ii) and (iii)
106. Which of these POP language?
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

a. Simula-67
b.Eiffel
c. C
d. None of these
107. Which of the keywords is used to allocate the space in dynamic memory for the storage of data
and functions belonging to an object.
a. Static
b. new
c. public
d. none of these
108. Which of these process by which one class acquires the properties and functionalities of another
class.
a. Inheritance
b. Polymorphism
c. Abstraction
d. None of these
109. Which of these is representation of an abstraction only.
a. Object
b. Class
c. Array
d. None of these
110. Wrapping of data and function together so that they can be applied as a unit to perform any
operation is termed as ________.
a. Inheritance
b. Polymorphism
c. Encapsulation
d. None of these
111. ________ refers to an act of represent essential features without including background details.
a. Polymorphism
b. Inheritance
c. Encapsulation
d. Abstraction

112. ________ is the process of using a function for more than one purpose.
a. Polymorphism
b. Inheritance
c. Encapsulation
d. None of these
113. ________ is the link establishing between function call and function signature.
a. Encapsulation
b. Dynamic Binding
c. Data hiding
d. None of these
114. An object is identify by its:
a. Characteristics
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. State
c. Attribute
d. Class
115. In POP stress is on:
a. Class
b. Function
c. Object
d. Data
116. A ________ is an object maker.
a. Class
b. Object
c. Program
d. Method
117. _______ principle of OOP promotes reusability feature.
a. Polymorphism
b. Inheritance
c. Encapsulation
d. None of these
118. Java is a Successor to which programming language?
a. C
b. C++
c. Python
d. None of these
119. Who invented Java language?
a. Dennis Ritchie
b. James Gosling
c. Larry Page
d. Serge Page
120. What is the original name of Java Programming language?
a. J++
b. C++
c. OAK
d. TEAK
121. Which laboratory was Java invented or developed in?
a. Bell Laboratory
b. Sun Microsystems
c. Dennis Ritchie Office
d. Johnson and Johnson
122. What type of Java Programs can be run inside a Java supported Web Browser?
a. Stand alone
b. Struts
c. Applets
d. AWT
123. What is an Interpreter?
a. An interpreter converts instructions line by line
b. An Interpreter converts source code to low-level code
c. Interpreters are slow to execute
d. All the above
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

124. What is a Compiler?


a. A Compiler converts all instructions in one go.
b. A compiler converts source code to low-level code
c. Compilers work fast
d. All the above
125. What is the file name extension of a Java source program?
a. .j
b. .ja
c. .java
d. .jax
126. What is the output of Compilation of Java Program?
a. .class file
b. .cla file
c. .jc file
d. .javax file
127. Byte code is the result of?
a. Compiling a Java file
b. Compiling a Class file
c. Interpreting a Java File
d. Interpreting a Class file
128. What software compiles a Java Program?
a. JRE (Java Runtime Environment)
b. JDK (Java Developer Kit)
c. JVM (Java Virtual Machine)
d. Command Prompt
129. What software runs a Java program on a computer?
a. JRE (Java Runtime Environment)
b. JDK (Java Developer Kit)
c. Command Prompt
d. None of the above
130. What does JVM stands for?
a. Java Variable Machine
b. Java Virtual Machine
c. Java Virtual Mechanism
d. None of the above
131. What is JVM?
a. JVM is the confined memory area
b. All java programs run inside JVM memory
c. JVM provides security to the computer by giving controlled access to Files and Memory on
a computer
d. All the above
132. What is JIT in Java?
a. Java In Timer
b. Java In Time Thread
c. Just In Time Compiler
d. Just In Time Runnable
133. JVM is an_______.
a. Interpreter
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. Machine Code
c. Compiler
d. Byte code
134. Every statement in Java language should end with a?
a. Dot or Period
b. Comma
c. Semicolon
d. Colon
135. All methods and variables in Java language are kept inside a?
a. File
b. Class or Interface
c. static method
d. main
136. What is the need to mention "static" before main method?
a. To call main method without creating an object of class
b. To make main method as class method common to all instances
c. Both A and B
d. None of the above
137. In standalone Java applications, which method is mandatory?
a. main method
b. show method
c. display method
d. print method
138. Choose a Single Line Comment in Java Language below?
a. //Some comments
b. Some comments//
c. /*Some comments*/
d. */Some comments/*
139. Choose a multiline comment in Java language below?
a. /*comments are going
cars are moving*/
b. */comments are going
cars are moving/*
c. //comments are going
cars are moving//
d. None of the above
140. What is the default return type of a method in Java language?
a. void
b. int
c. short
d. None of the above
141. Name of a Class, Variable, Method or an Interface in Java language is called?
a. Argument
b. Value
c. Identifier
d. None of the above
142. A java program that can be developed and execute by the user, is known as
a. Application
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. Applet
c. Object
d. None of these
143. To find the square root of a number which of the following package is required?
a. java.txt
b. java.lang
c. java.math
d. java.net
144. The term used to correct the error in program, is known as:
a. Bug
b. Error removing
c. Debugging
d. None of these
145. The high level language program when converted to machine level, is known as:
a. Source code
b. Object code
c. Program code
d. None of these
146. Suppose an integer variable ‘a’ is residing at memory address 3025, and holding value as 10. So
what is lvalue?
a. ‘a’
b. 10
c. 3025
d. int
147. What is the use of ‘final’ keyword?
a. Makes a variable permanent storage in the memory
b. Makes a variable as global access specifies
c. Makes a variable as temporary storage
d. Makes a variable as constant
148. What will be the output of the following statement?
System.out.println(Math.abs(Math.ceil(-30.46)));
a. 30.46
b. 31.46
c. -31.46
d. 29.46
149. Suppose we want to generate the random values from 1 to 6 for a Dice. What will be the code?
a. System.out.println((int)Math.random()*(6-1)+1);
b. System.out.println((int)Math.random()*(6-1));
c. System.out.println((int)Math.random()*(6-1+1)+6);
d. System.out.println((int)Math.random()*(6-1+1)+1);
150. A group of multiple statement within balanced braces are called as
a. block
b. statements
c. Coercion
d. Expression
151. What is Literal in Java?
a. Literal is the value that is given or assigned to a variable.
b. Literal is a data type
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

c. Literal is similar to String


d. None of the above
152. In a switch case, when the value of the does not satisfied then the execution transfers to:
a. A break statement
b. A default statement
c. A loop
d. None
153. A compound statement in Java programming is enclosed in
a. Parenthesis
b. Breaks
c. Square brackets
d. All of these
154. What are the types of Literals available in Java language?
a. Integer and Float
b. Character and String
c. Boolean
d. All the above
155. If condition essentially formatted by using:
a. Arithmetic operator 
b. logical operator 
c. relation operator 
d. ternary operator 
156. An Octal number is Java is represented with a leading ____?
a. (Alphabet)
b. 0 (ZERO)
c. 0x
d. 0X
157. if((a!=b)&&(a==c)), then which of the statement is true:-
a. b is the smaller number than a
b. b is the greater number than a
c. a is the smallest number
d. both (a) and (b)
158. What is the prefix used to represent Octal numbers in Java?
a. 0x
b. 0X
c. a and b
d. None of the above
159. Choose a correct rule for using Underscores in literals of Java language.
a. Underscores cannot come at the end of a number or next to the last digit of a number.
b. Underscores cannot come at the beginning of a number or before the first digit of a number.
c. Underscores cannot come before or after a decimal point in real numbers like float and
double.
d. All the above
160. if((a>b)&&(b>c)&&(c>d)) means:
a. d is the greater number
b. d is the smallest number
c. a is the smallest number
d. all of the above
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

161. What is the name given to character literals in Java that start with a Back Slash character?
a. Back Slash Sequence
b. Slash Sequence
c. Escape Sequence
d. Extended Sequence
162. Two Arithmetic expression can be compare with if statement using
a. Arithmetic operator
b. Null operator
c. Logical operator
d. Ternary operator
163. Which of the following statement is selective statement?
a. if
b. goto
c. for
d. none of these
164. What is the precision after decimal points offered by a float data type in Java?
a. 3 digits
b. 6 digits
c. 10 digits
d. 15 digits
165. Which of the following statement is most appropriate for the break statement?
a. Cannot be used in switch statement
b. Can be used in switch statement
c. Is compulsory to be used in a switch statement
d. None of these
166. A real number literal for floating point literal with a missing f or F suffix represents which data
type?
a. double
b. float
c. long
d. int
167. A java programming executes but does not give the output. It is due to the:
a. Logical error in the program
b. Syntax error in the program
c. Runtime error in the program
d. None of these
168. A character literal in Java is enclosed within a pair of ___?
a. Square brackets
b. Double Quotes
c. Single Quotes
d. Exclamations
169. A String literal in Java is surrounded by a pair of _____?
a. Braces
b. Single Quotes
c. Double Quotes
d. Exclamations
170. When the statements are execute sequentially in a program, the construct is known as
a. Iteration
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

b. Sequence
c. Selection
d. None
171. What are the Type Conversions available in Java language?
a. Narrowing Type Conversion
b. Widening Type Conversion
c. A and B
d. None of the above
172. Which of the following statement is to be execute with fixed iteration?
a. for
b. while
c. do-while
d. If-else
173. While of the following loop executes at least one time in a program?
a. do-while
b. while
c. for
d. nested for
174. An Arithmetic expression in Java involves which Operators or Operations?
a. Addition (+), Subtraction (-)
b. Multiplication (*), Division (/)
c. Modulo Division (%), Increment/Decrement (++/--), Unary Minus (-), Unary Plus (+)
d. All the above
175. Which of the following statement helps to take jump from loop to another loop?
a. count
b. continue
c. switch
d. break
176. Choose the Compound Assignment Arithmetic Operators in Java below.
a. +=, -=
b. *=, /=
c. %=
d. All the above
177. Which of these following loop checks the condition first and then execute begins?
a. do-while
b. do
c. while loop
d. for
178. In a nested loop, which loop close at last?
a. Innermost loop
b. Outermost loop
c. Inner & outer together
d. None
179. Which operator group has higher priority between (>, >=, <, <=) and (==, !=)?
a. (>, >=, <, <=) has lower priority (==, !=)
b. (>, >=, <, <=) has higher priority (==, !=)
c. (>, >=, <, <=) has equal priority with (==, !=)
d. None of the above
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

180. What is the data type of output of any Comparison Operation in Java?
a. int
b. char
c. boolean
d. byte
181. Which of the following statement allows repetitive execution the statement?
a. do-while
b. while
c. for
d. All of the above
182. What is the other name for a Question Mark - Colon (?:) operator in Java?
a. Special Relational operator
b. Special Logical Operator
c. Ternary Operator
d. None
183. Java Ternary operator is sometimes called ____.
a. Relational Operator
b. Conditional Operator
c. Logical Operator
d. None
184. The condition of a Java Ternary operator should evaluate to ___.
a. 1 or 0
b. true or false
c. TRUE or FALSE
d. None
185. Choose a possible error with a Ternary operator while compiling a Java program.
a. The left-hand side of an assignment must be a variable.
b. void is an invalid type for the variable
c. Type mismatch: cannot convert from void to int
d. All of the above
186. An IF-ELSE statement is also called ___.
a. Branching statement
b. Control statement
c. Block statements
d. All of these
187. An IF or ELSE IF statement accepts ___ as input before branching.
a. boolean
b. int
c. float
d. char
188. An IF statement in Java is also a ___ statement.
a. boolean
b. conditional
c. iterative
d. optional
189. The condition of an IF statement evaluates to boolean only if the expression contains?
a. logical operators
b. relational operators
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

c. boolean operands
d. All
190. If the condition of an IF-statement is false, which is true below.
a. IF block is executed.
b. ELSE block is executed.
c. Both IF and ELSE blocks are skipped.
d. Both IF and ELSE blocks are executed.
191. An IF-ELSE statement is better than a SWITCH statement in which scenario below?
a. Checking for More-than condition
b. Checking for Less-than condition
c. Checking for Ranges
d. All
192. A SWITCH case statement in Java is a ___ control statement.
a. Iteration
b. Loop
c. Selection
d. Jump
193. Which is the alternative to SWITCH in Java language?
a. break, continue
b. for, while
c. if, else
d. goto, exit
194. What are the keywords used to implement a SWITCH case in Java language?
a. switch, case
b. default
c. break
d. All
195. A SWITCH statement accepts ___ type of data as input.
a. byte
b. short
c. int
d. All
196. A SWITCH fall through occurs in Java only in the absence of ___.
a. case keyword
b. break keyword
c. default keyword
d. None
197. What is the purpose of designing a SWITCH logic with a fall-through in Java?
a. To define ranges.
b. To define additions
c. To improve switch block performance
d. None
198. What is a Loop in Java programming language?
a. A Loop is a block of code that is executed repeatedly as long as a condition is satisfied.
b. A Loop is a block of code that is executed only once if the condition is satisfied.
c. A Loop is a block of code that is executed more than 2 times if the condition is satisfied.
d. None
Class X
Global IQ Computer Education Centre
8,School Road, , Dum Dum Cantt. Kol-28 MCQ Questions
Ph:- 2590-1995, 9433103218.

199. A BREAK statement inside a Loop like WHILE, FOR, DO WHILE and Enhanced-FOR causes the
program execution ___ Loop.
a. Exit
b. Continuation with next iteration
c. Never exit
d. None
200. Choose the Java-Code below with a never-ending loop.
a. while(true);
b. for(;true;);
c. do
{
;
}while(true);
d. All
201. What is the main difference between a WHILE and a DO-WHILE loop in Java?
a. WHILE loop executes the statements inside of it at least once even if the condition is false.
b. DO-WHILE loop executes the statements inside of it at least once even if the condition is
false.
c. WHILE loop is fast.
d. DO-WHILE loop is fast.
202. A Loop in Java language may contain ___.
a. Any loop
b. IF-ELSE statements
c. SWITCH statements
d. All

You might also like