0

Possible Duplicate:
Direct casting vs 'as' operator?

as doesn't throw an exception, but wouldn't it result in a NullPointerException later? doesn't it make it harder to debug?

Community
  • 1
  • 1
Louis Rhys
  • 32,677
  • 53
  • 143
  • 218

1 Answers1

1

after using the as, you should always check for null.

Ghyath Serhal
  • 7,290
  • 6
  • 42
  • 59