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
  • 34,517
  • 56
  • 153
  • 221

1 Answers1

1

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

Ghyath Serhal
  • 7,466
  • 6
  • 44
  • 60