Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- The (type) notation has two semantics with the same syntax.
- The first is for type casting and second is for unboxing.
- */
- double a = 2.3;
- object b = (object) a;
- double c = (double) b; // ok
- double x = 4.2;
- object y = (object) x;
- int z = (int)y; // System.InvalidCastException on unboxing.
Advertisement
Add Comment
Please, Sign In to add comment