🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.double to int
  2. B.long to int
  3. C.int to double
  4. 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 →