PRACTICE / UNDERSTAND / REPEAT

Java: Types & casting

Practice types & casting with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

15 questionsAnswers explainedFree · no login
Question 1 of 15
Types & casting · MCQQuestion link ↗

What may happen when a long is narrowed to int?

Choose one answer
Answer & explanation

Answer: High-order bits may be discarded

Narrowing integer conversion can lose information without throwing an exception.