Java OCA OCP Practice Question 1243

Question

Which of the following are valid double literals?

  • A. 1D
  • B. 1E-5D
  • C. e2d
  • D. 1ed


A and B.

Note

Since the value e2d begins with a letter, it is treated as an identifier.

Since there is no signed integer value after the e in 1ed, it is an invalid double literal.




PreviousNext

Related