EXAM QUESTIONS AND ANSWERS LATEST
1. Which of the following are Java program keyword categories?
(A) Reserved words, pre-defined identifiers and user-defined identifiers
(B) Reserved pre-defined identifiers, reserved user-defined identifiers and
library identifiers
(C) void, static, println.
(D) None of the above: a
2. Consider the two program segments below.
Segment A Segment B
int a; int a = 100;
int b; int b = 200;
a = 100;
b = 200;
What is true about the comparison of these two segments?
(A) Segment A is correct and segment B is not correct.
(B) Segment A is incorrect and segment B is correct.
(C) Segment A and segment B are both correct.
(D) segment A and segment B are both incorrect.: c
3. Consider the two program segments below.
Segment A Segment B
int a; int a = 100;
int b; int b = 200;
System.out.println(a); System.out.println(a);
System.out.println(b); System.out.println(b);
What is true about the comparison of these two segments?
(A) Segment A is correct and segment B is not correct.
(B) Segment A is incorrect and segment B is correct.
(C) Segment A and segment B are both correct.
(D) segment A and segment B are both incorrect.: b
4. Which of the following are examples of reserved words?
(A) public, void and static
(B) System, out and println
(C) System, public and void
1/9
, (D) print, println and args: a
5. Which of the following are Java integer data types?
(A) byte, short, integer and longInteger
(B) shortInt, int and longInt
(C) byteInt, shortInt, int and longInt
(D) byte, short, int and long: d
2/9