When is handling a null pointer/reference exception preferred over doing a null check?
问题 I have an odd question that I have always thought about, but could never see a practical use for. I'm looking to see if there would be enough justification for this. When is handling a null pointer/reference exception preferred over doing a null check? If at all. This applies to any language that has to deal with null pointers/references which has exception handling features. My usual response to this would be to perform a null check before doing anything with the pointer/reference. If non