• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
checking for null Noob question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

checking for null Noob question


  • Subject: checking for null Noob question
  • From: Theodore Petrosky <email@hidden>
  • Date: Sat, 31 Jul 2010 05:05:40 -0700 (PDT)

Why does this work:

public String dueDateTypeLetter() {

if (this.dueDateType() == null || this.dueDateType().equals("N")) {
return "";
}
return this.dueDateType();
}

and this doesn't....

public String dueDateTypeLetter() {

if (this.dueDateType().equals("N") || this.dueDateType() == null) {
return "";
}
return this.dueDateType();
}

obviously the difference is the order of checking in the 'if' statement...

I don't really care that I must check in a specific order... It just took me time to understand that the order was important.

Ted






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: checking for null Noob question
      • From: Paul Hoadley <email@hidden>
    • Re: checking for null Noob question
      • From: Jérémy DE ROYER <email@hidden>
  • Prev by Date: Re: SVN and Eclipse
  • Next by Date: Re: checking for null Noob question
  • Previous by thread: Re: Hudson builds and framework dependencies
  • Next by thread: Re: checking for null Noob question
  • Index(es):
    • Date
    • Thread