← Quiz: Java Data Types: all 10 questions
Quiz: Java Data Types · Question 9 of 10
Which conversion happens automatically, without a cast?
Which conversion happens automatically, without a cast?
- A.double to int
- B.long to int
- C.int to double
- D.double to float
Answer & explanation
Correct answer: int to double
Widening (small type to bigger type) is automatic. The others are narrowing and need a cast because data can be lost.
Can you get the rest right without peeking?
Take the timed Quiz: Java Data Types quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →