• 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
Beginnerquestion about if (personName==null || personName.equals(""))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Beginnerquestion about if (personName==null || personName.equals(""))


  • Subject: Beginnerquestion about if (personName==null || personName.equals(""))
  • From: Rainer User <email@hidden>
  • Date: Fri, 7 Sep 2007 11:44:11 +0200


Hi Folks,
i am new at the webobjects-dev maillist and new to webobjects too.

I am reading the white printed book "Webobjects 5, Web Applications", from Apple, it was included in the Webobjects Package of my Webobject-Box.

On Page 84 i found an example where a funktion trys to detect if a variable named "personName" [type of it is "String"] is empty or not.

The substantial Code says:

if (personName==null || personName.equals(""))
{
return(true);
}
else
{
return(false);
}




In my opinion it would be the same if i write only:

if (personName==null)
{
return(true);
}
else
{
return(false);
}

Where is my misunderstanding?
Why i have to use personName.equals("")   +and+    personName==null to detect if personName is empty or not?


Maybe someone can help me ore give me a hint?



Thanks from Germany,

Thomas


 _______________________________________________
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: Beginnerquestion about if (personName==null || personName.equals(""))
      • From: Ian Joyner <email@hidden>
    • Re: Beginnerquestion about if (personName==null || personName.equals(""))
      • From: Lachlan Deck <email@hidden>
    • Re: Beginnerquestion about if (personName==null || personName.equals(""))
      • From: Ray Kiddy <email@hidden>
    • Re: Beginnerquestion about if (personName==null || personName.equals(""))
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: Maybe No Need for a WOBuilder Replacement?
  • Next by Date: Re: Beginnerquestion about if (personName==null || personName.equals(""))
  • Previous by thread: re: Ajax File Uploader / WOLongResponse File Uploader
  • Next by thread: Re: Beginnerquestion about if (personName==null || personName.equals(""))
  • Index(es):
    • Date
    • Thread