PRACTICE / UNDERSTAND / REPEAT

Java practice question

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

1 questionAnswers explainedFree · no login

Try this question

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.