Unit 1: Primitive Types

Showing 20 of 23 questions

Q1
MULTIPLE_CHOICEEasy

What is the value of result after the following code executes?

Q2
MULTIPLE_CHOICEMedium

What is the output of the following code?

Q3
MULTIPLE_CHOICEHard

What is the value of x after the following code executes?

Q4
MULTIPLE_CHOICEMedium

What is the output of the following code?

Q5
MULTIPLE_CHOICEMedium

What is the output of the following code?

Q6
MULTIPLE_CHOICEEasy

What is the value of b after the following code executes?

Q7
MULTIPLE_CHOICEHard

What is the output of the following code?

Q8
MULTIPLE_CHOICEMedium

What is the output of the following code?

Q9
MULTIPLE_CHOICEEasy

What is the output of the following code?

Q10
MULTIPLE_CHOICEMedium

What is the output of the following code?

Q11
MULTIPLE_CHOICEEasy

What is the result of 7 / 2 in Java when both operands are ints?

Q12
MULTIPLE_CHOICEEasy

What does the expression 17 % 5 evaluate to in Java?

Q13
MULTIPLE_CHOICEMedium

What is the value of (int) 9.7 in Java?

Q14
MULTIPLE_CHOICEEasy

What is the value of x after: int x = 5; x += 3; x *= 2;

Q15
MULTIPLE_CHOICEMedium

What is the output?\nint a = 5;\nSystem.out.println(a++);

Q16
MULTIPLE_CHOICEMedium

What is the result of: double d = 5 / 2;

Q17
MULTIPLE_CHOICEHard

What happens if you add 1 to Integer.MAX_VALUE in Java?

Q18
MULTIPLE_CHOICEMedium

What is the result of: 5 + 3.0?

Q19
MULTIPLE_CHOICEMedium

What is the output of the following code segment? \nint a = 11;\nint b = 4;\ndouble c = a / b;\nint d = a % b;\nSystem.out.println(c + " " + d);

Q20
MULTIPLE_CHOICEHard

Consider the following code segment. \nint x = 7;\nint y = 3;\nint z = x-- + ++y;\nSystem.out.println(x + " " + y + " " + z);

Advertisement