Java Language | 10 Minute‐Test 4


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.

An expression involving byte, int, and literal numbers is promoted to which of these?

A.
int
B.
long
C.
byte
D.
float

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

An expression involving bytes, ints, shorts, literal numbers, the entire expression is promoted to int before any calculation is done.

2.

Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?

A.
ASCII
B.
ISO-LATIN-1
C.
None of the mentioned
D.
ASCII and ISO-LATIN1

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

First 0 to 127 character set in Unicode are same as those of ISO-LAIN-1 and ASCII.

3.

Literal can be of which of these data types?

A.
integer
B.
float
C.
boolean
D.
all of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

4.

If an expression contains double, int, float, long, then whole expression will promoted into which of these data types?

A.
long
B.
int
C.
double
D.
float

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

If any operand is double the result of expression is double.

5.

Which of these is an incorrect Statement?

A.
It is necessary to use new operator to initialize an array.
B.
Array can be initialized using comma separated expressions surrounded by curly braces.
C.
Array can be initialized when they are declared.
D.
None of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

Array can be initialized using both new and comma separated expressions surrounded by curly braces example : int arr[5] = new int[5]; and int arr[] = { 0, 1, 2, 3, 4};

6.

Decrement operator, −−, decreases value of variable by what number?

A.
1
B.
2
C.
3
D.
4

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None.

7.

Which right shift operator preserves the sign of the value?

A.
<<
B.
>>
C.
<<=
D.
>>=

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None.

8.

Which of these operators can skip evaluating right hand operand?

A.
!
B.
|
C.
&
D.
&&

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

Operator short circuit and, &&, and short circuit or, ||, skip evaluating right hand operand when output can be determined by left operand alone.

9.

What is the order of precedence (highest to lowest) of following operators?
1. &
2. ^
3. ?:

A.
1 -> 2 -> 3
B.
2 -> 1 -> 3
C.
3 -> 2 -> 1
D.
2 -> 3 -> 1

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None.

10.

Which of these jump statements can skip processing remainder of code in its body for a particular iteration?

A.
break
B.
return
C.
exit
D.
continue
Submit your test now to view the Results and Statistics with answer explanation.