

MCQOPTIONS
Saved Bookmarks
This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
251. |
What is the input for Logical Operators? |
A. | 1 and 0 |
B. | true / false |
C. | char / String |
D. | None of the above |
Answer» C. char / String | |
252. |
In general Bitwise logical operators are simply called? |
A. | Logical operators |
B. | Bitwise operators |
C. | Binary operators |
D. | None of the above |
Answer» C. Binary operators | |
253. |
Bitwise logical operators in Java work with? |
A. | true/false boolean data |
B. | 0 and 1 individual bits of data |
C. | Characters of a String |
D. | None of the above |
Answer» C. Characters of a String | |
254. |
Boolean logical operators in Java work with? |
A. | true/false boolean data |
B. | 1 and 0 of individual Bits |
C. | characters of a String |
D. | None of the above |
Answer» B. 1 and 0 of individual Bits | |
255. |
What are the two possible Logical Operator types? |
A. | Bitwise Logical |
B. | Boolean Logical |
C. | Arithmetic Logical |
D. | A and B |
Answer» E. | |
256. |
What is the default character literal value assigned to a char variable in Java? |
A. | 'a' |
B. | '0' |
C. | '\u0000' |
D. | 0 |
Answer» D. 0 | |
257. |
What is the default boolean literal assigned to a boolean variable in Java? |
A. | true |
B. | false |
C. | undefined |
D. | None of the above |
Answer» C. undefined | |
258. |
A Unicode character literal in Java is surrounded by a pair of ___? |
A. | Single Quotes |
B. | Double Quotes |
C. | Exclamations |
D. | Backslashes |
Answer» B. Double Quotes | |
259. |
Choose the wrong representation of a character literal in Octal notation in Java. |
A. | char ch='\65'; |
B. | char ch='\142'; |
C. | char ch='\065'; |
D. | char ch='142'; |
Answer» E. | |
260. |
Choose the wrong Java code statement below. |
A. | boolean a = false; |
B. | boolean a = (5>6)||(4>3); |
C. | boolean a = 1; |
D. | boolean a = 4>3?true:false; |
Answer» D. boolean a = 4>3?true:false; | |
261. |
What is the output of this Java snippet? |
A. | 111 |
B. | 7 |
C. | 8 |
D. | Compiler error |
Answer» C. 8 | |
262. |
Choose the correct usage of boolean literal in the options below. |
A. | boolean b= false; |
B. | boolean b= 2<4; |
C. | if(true) |
D. | All the above |
Answer» E. | |
263. |
Choose the correct implementation of floating point literals in the exponential form in Java. |
A. | float a = 12.0e2f; //1200.0 |
B. | float a = 100.0e-2f; // 1.0 |
C. | float a = 123.456e-21f; |
D. | All the above |
Answer» E. | |
264. |
What are the two floating point notations in Java language? |
A. | Exponential e or E (10^a) |
B. | Exponential p or P (2^a) |
C. | A and B |
D. | None of the above |
Answer» D. None of the above | |
265. |
Which version of Java introduced Hexadecimal floating point numbers? |
A. | JDK 5 |
B. | JDK 6 |
C. | JDK 7 |
D. | JDK 8 |
Answer» D. JDK 8 | |
266. |
Which among the following is not a primitive data type in Java? |
A. | char |
B. | String |
C. | byte |
D. | short |
Answer» C. byte | |
267. |
A String literal in Java is surrounded by a pair of _____? |
A. | Braces |
B. | Single Quotes |
C. | Double Quotes |
D. | Exclamations |
Answer» D. Exclamations | |
268. |
Choose a correct statement about Java literal types. |
A. | Decimal literal uses Base 10 number system. |
B. | Binary literal uses Base 2 number system. |
C. | Octal literal uses Base 8 number system. |
D. | All the above |
Answer» E. | |
269. |
Which version of Java started offering unsigned int and unsigned long to represent very long numbers? |
A. | JDK 5 |
B. | JDK 6 |
C. | JDK 7 |
D. | JDK 8 |
Answer» E. | |
270. |
A character literal in Java is enclosed within a pair of ___? |
A. | Square brackets |
B. | Double Quotes |
C. | Single Quotes |
D. | Exclamations |
Answer» D. Exclamations | |
271. |
What is the suffix used to convert an int literal to long literal in Java? |
A. | 0l or 0L |
B. | l or L |
C. | i or I |
D. | 0x or 0X |
Answer» C. i or I | |
272. |
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 |
Answer» B. float | |
273. |
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 |
Answer» C. 10 digits | |
274. |
What is the suffix used to represent a floating point number in Java? |
A. | r or R |
B. | f or F |
C. | fl or FL |
D. | None of the above |
Answer» C. fl or FL | |
275. |
What is the common UTF standard used on the Websites for information exchange? |
A. | UTF 16 |
B. | UTF 8 |
C. | UTF 32 |
D. | None of the above |
Answer» C. UTF 32 | |
276. |
What is the literal in Java that can be used to test whether an Object of any type is alive or not? |
A. | alive |
B. | liveof |
C. | null |
D. | 0 |
Answer» D. 0 | |
277. |
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 |
Answer» D. Extended Sequence | |
278. |
Java uses UTF-16 Unicode format to represent characters. What is UTF? |
A. | Universal Transcript Format |
B. | Universal Transformation Format |
C. | Universal Technology Format |
D. | None of the above |
Answer» C. Universal Technology Format | |
279. |
What is the maximum number of Underscore characters that can be used in between the digits of a numeric literal in Java? |
A. | 8 |
B. | 16 |
C. | 32 |
D. | No Limit |
Answer» E. | |
280. |
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 |
Answer» E. | |
281. |
What is the compiler error for improperly using Underscores ( _ ) in literals in Java? |
A. | Underscores are out of range |
B. | IllegalUnderscoresException |
C. | Underscores have to be located within digits |
D. | Too many Underscores |
Answer» D. Too many Underscores | |
282. |
What is the correct representation of using Binary literals in Java? |
A. | int a = 0b1010; |
B. | int a = 0B1011_1010; |
C. | int a = 0B0______________1; |
D. | All the above |
Answer» E. | |
283. |
What is the prefix used to represent Binary literals in Java? |
A. | b or B |
B. | 0b or 0B |
C. | xB or xb |
D. | ob or oB |
Answer» C. xB or xb | |
284. |
Underscore symbols in literal numbers are introduced with which version of Java? |
A. | JDK 5 |
B. | JDK 6 |
C. | JDK 7 |
D. | JDK 8 |
Answer» D. JDK 8 | |
285. |
Binary literals in Java are introduced with which version of Java? |
A. | JDK 5 |
B. | JDK 6 |
C. | JDK 6 |
D. | JDK 8 |
Answer» D. JDK 8 | |
286. |
Choose correct examples of Hexadecimal literals in Java? |
A. | long a = 0X987654321L; |
B. | int a = 0x76FE____23; |
C. | byte b = 0X0__________F; |
D. | All the above |
Answer» E. | |
287. |
What is the prefix used to represent Hexadecimal numbers in Java? |
A. | 0x |
B. | 0X |
C. | A and B |
D. | None of the above |
Answer» E. | |
288. |
Choose the correct example of Octal Literal in Java? |
A. | short = 0564; |
B. | int = 076__45_2; |
C. | int = 0______11; |
D. | All the above |
Answer» E. | |
289. |
Choose correct ranges for Decimal, Octal and Hexadecimal numbers in Java? |
A. | Decimal: 0 to 9 |
B. | Octal: 0 to 7 |
C. | Hexadecimal: 0 to 9 and A to F / a to f |
D. | All the above |
Answer» E. | |
290. |
An Octal number is Java is represented with a leading ____? |
A. | O (Alphabet) |
B. | 0 (ZERO) |
C. | 0x |
D. | 0X |
Answer» C. 0x | |
291. |
Choose correct examples of decimal literals in Java. |
A. | int a = 12345; |
B. | int a = 12_3__5; |
C. | long a = 987____654_3__21L; |
D. | All the above |
Answer» E. | |
292. |
What are the types of Integer Literals in Java? |
A. | Decimal Literals |
B. | Octal and Hexadecimal Literals |
C. | Binary Literals |
D. | All the above |
Answer» E. | |
293. |
What are the types of Literals available in Java language? |
A. | Integer and Float |
B. | Character and String |
C. | Boolean |
D. | All the above |
Answer» E. | |
294. |
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 |
Answer» B. Literal is a data type | |
295. |
What is the output of Java Program with Shift Right Fill Zeroes operator? |
A. | -8, 4 |
B. | 8, 4 |
C. | 8, -4 |
D. | -8, -4 |
Answer» C. 8, -4 | |
296. |
What is the output of a Java Program with Shift Right Fill Zeroes (>>>) operator? |
A. | -8, 8 |
B. | -8, 4 |
C. | -8, -4 |
D. | Compiler error |
Answer» D. Compiler error | |
297. |
What is the output of the Java program with Right Shift (Without Fill Zeroes)? |
A. | -8, -16 |
B. | -4, -8 |
C. | -8, -4 |
D. | Compiler error |
Answer» D. Compiler error | |
298. |
What is the output of Java program with Right Shift Operator (>>)? |
A. | 5,-6 |
B. | 5,10 |
C. | 5, 2 |
D. | Compiler error |
Answer» D. Compiler error | |
299. |
What is the output of the Java program with Left Shift Operator (<<)? |
A. | 5,2 |
B. | 5,5 |
C. | 5,10 |
D. | Compiler error |
Answer» D. Compiler error | |
300. |
What is the output of a Bitwise Exclusive OR (^) operation if both the inputs/operands are different? |
A. | 0 |
B. | 1 |
C. | 0 or 1 |
D. | None of the above |
Answer» C. 0 or 1 | |