Java Language | 10 Minute‐Test 5


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

Which of these literals can be contained in float data type variable?

A.
-1.7e+308
B.
-3.4e+038
C.
+1.7e+308
D.
-3.4e+050

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Range of float data type is -(3.4e38) To +(3.4e38)

2.

Which one is a valid declaration of a boolean?

A.
boolean b1 = 1;
B.
boolean b2 = ‘false’;
C.
boolean b3 = false;
D.
boolean b4 = ‘true’

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

Boolean can only be assigned true or false literals.

3.

Which of these can not be used for a variable name in Java?

A.
identifier
B.
keyword
C.
identifier & keyword
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

Keywords are specially reserved words which can not be used for naming a user defined variable, example : class, int, for etc.

4.

What is Truncation is Java?

A.
Floating-point value assigned to an integer type.
B.
Integer value assigned to floating type
C.
Floating-point value assigned to an Floating type.
D.
Integer value assigned to floating type.

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None.

5.

Which of these is necessary to specify at time of array initialization?

A.
Row
B.
Column
C.
Both Row and Column
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None.

6.

Which of these statements are incorrect?

A.
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms.
B.
Assignment operators run faster than their equivalent long forms.
C.
Assignment operators can be used only with numeric and character data type.
D.
None

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None.

7.

Which of these statements are incorrect?

A.
The left shift operator, <<, shifts all of the bits in a value to the left specified number of times.
B.
The right shift operator, >>, shifts all of the bits in a value to the right specified number of times.
C.
The left shift operator can be used as an alternative to multiplying by 2.
D.
The right shift operator automatically fills the higher order bits with 0.

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The right shift operator automatically fills the higher order bit with its previous contents each time a shift occurs. This also preserves the sign of the value.

8.

Which of these statement is correct?

A.
true and false are numeric values 1 and 0.
B.
true and false are numeric values 0 and 1.
C.
true is any non zero value and false is 0.
D.
true and false are non numeric values.

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

true and false are keywords, they are non numeric values which do no relate to zero or non zero numbers. true and false are boolean values.

9.

Which of these statements are incorrect?

A.
Equal to operator has least precedence.
B.
Brackets () have highest precedence.
C.
Division operator, /, has higher precedence than multiplication operator.
D.
Addition operator, +, and subtraction operator have equal precedence.

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

Division operator, /, has equal precedence as of multiplication operator. In expression involving multiplication and division evaluation of expression will begin from right side when no brackets are used.

10.

Which of these statement is incorrect?

A.
switch statement is more efficient than a set of nested if.
B.
two case constants in the same switch can have identical values.
C.
switch statement can only test for equality, whereas if statement can evaluate any type of boolean expression.
D.
it is possible to create a nested switch statements.
Submit your test now to view the Results and Statistics with answer explanation.