Multiple choice technology web technology

A cast between datatypes can give you illegal values where as a Convert will throw error if you try to do illegal operations.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Casting between datatypes can succeed but produce illegal values (e.g., casting a large double to int silently truncates), while Convert methods throw exceptions for invalid operations (e.g., Convert.ToInt32("abc") throws FormatException). Casting is unchecked; Convert validates the operation.