Re: Checking for null parameter



pek wrote:
How do you prevent an exception? By checking if the object is null
before calling a method? How is that preventing? What will it do after
not calling the method? Inform the user for an abnormal situtation and
then close? Isn't this the same thing as if a NPE was thrown? Why even
bother? Because in any case, your code has a bug. Either way, the
program must end because the method wasn't executaded as it had to.

Sample recovery dialog:

"We're sorry, but remote document storage seems to be unavailable. Would you like to store your document locally until the remote document storage is back? (Y/n) _"

--
Lew
.



Relevant Pages

  • Re: Checking for null parameter
    ... before calling a method? ... but remote document storage seems to be unavailable. ... } catch (ConnectionException e) { ... public void startProgram() { ...
    (comp.lang.java.programmer)
  • Re: D programming language
    ... >> declaration it shouldn't be necessary when calling such a function. ... >> itself or preventing it from the start. ... O. Wyss ...
    (comp.programming)
  • Re: XP SP2
    ... >Do any retail stores like best buy, circuit city, gateway ... >carry the XP SP2 CD? ... What's preventing you from calling them and asking? ...
    (microsoft.public.windowsxp.general)