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. |
What is the range of byte data type in Java? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Byte occupies 8 bits in memory. Its range is from -128 to 127. |
2. |
Which of these coding types is used for data type characters in Java? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Unicode defines fully international character set that can represent all the characters found in all human languages. Its range is from 0 to 65536. |
3. |
Which of these can be returned by the operator & ? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: We can use binary ampersand operator on integers/chars (and it returns an integer) or on booleans (and it returns a boolean). |
4. |
What is the prototype of the default constructor of this class? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option D Explanation: None. |
5. |
What is the output of this program? class array_output { public static void main(String args[]) { int array_variable[][] = {{ 1, 2, 3}, { 4 , 5, 6}, { 7, 8, 9}}; int sum = 0; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3 ; ++j) sum = sum + array_variable[i][j]; System.out.print(sum / 5); } } |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option B Explanation: None. |
6. |
Modulus operator, %, can be applied to which of these? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: Modulus operator can be applied to both integers and floating point numbers. . |
7. |
Which operator is used to invert all the digits in binary representation of a number? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option A Explanation: Unary not operator, ~, inverts all of the bits of its operand in binary representation. |
8. |
Which of these is returned by “greater than”, “less than” and “equal to” operators? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: All relational operators return a boolean value ie. true and false. |
9. |
What should be expression1 evaluate to in using ternary operator as in this line? |
|||||||||||||||||||
Your Answer: Option (Not Answered) Correct Answer: Option C Explanation: The controlling condition of ternary operator must evaluate to boolean. |
10. |
Which of these are selection statements in Java? |
|||||||||||||||||||
|