Java OCA OCP Practice Question 976

Question

Which of the following are legal? (Choose all that apply.)

  • A. double d = 1.2d;
  • B. double d = 1.2D;
  • C. double d = 1.2d5;
  • D. double d = 1.2D5;


A, B.

Note

The d suffix in option A and the D suffix in option B are optional.

Options C and D are illegal because the notation requires e or E, not d or D.




PreviousNext

Related