C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers


10.7k users

Recent questions tagged casting

0 votes
1 answer 21 views
asked smith Geek 15.3k points 14 39 58
0 votes
1 answer 25 views
In development blogs, online code examples and (recently) even a book, I keep stumbling about code like this: var y = x as T; y.SomeMethod(); or, even worse: (x as T).SomeMethod(); That doesn't make sense to me. If you are sure ... to check for null before performing some operation. All that the above code does is to turn a (useful) InvalidCastException into a (useless) NullReferenceException.
asked shivani Sr Member 1.1k points 13 27 42
0 votes
2 answers 32 views
asked aryan Jr Member 840 points 1 2 11
To see more, click for the full list of questions or popular tags.