Skip to content
Sharp

Core Java · interview question

Which of the following is an example of a numeric literal for a double in Java?

Multiple choiceEasychapter-1-curatedpremiumcore-javanumeric-types-and-money-basics
Choose one answer
Answer and explanation

Correct answer

C. 123.45

Why

A double literal in Java can be written with a decimal point, such as 123.45. The 'd' suffix is optional.

Test yourself on Core Java

A free test with instant, explained results. No account needed.

Start free test
All Core Java questions →