Java SE 11 Developer (1Z0-819) — Question 27
Which three initialization statements are correct? (Choose three.)
Answer options
- A. int[][][] e = {{1,1,1},{2,2,2}};
- B. short sh = (short)’A’;
- C. float x = 1f;
- D. byte b = 10; char c = b;
- E. String contact# = “(+2) (999) (232)”;
- F. int x = 12_34;
- G. boolean false = (4 != 4);
Correct answer: C, B, F
Explanation
The correct answers are C, B, and F. Option C initializes a float with a literal that includes an 'f', option B correctly casts a character to a short, and option F uses underscores for better readability in an integer. Options A and E contain syntax errors, D has a type mismatch, and G incorrectly uses 'false' as a variable name, which is a reserved keyword.