• 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
a simple Java question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a simple Java question


  • Subject: a simple Java question
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 4 Jan 2011 03:51:25 -0800 (PST)


if (estimates() && jobIsClosed() || !jobIsClosed()) {}

I have these accessors (estimates()  jobIsClosed()). Do I need to parenthesize the second part of this to be correct:

if (estimates() && (jobIsClosed() || !jobIsClosed())) {}


the first example is working as I intend, but I originally had:

if (estimates() && jobIsClosed() || estimates() && !jobIsClosed()) {}


I was reading and searching on Java precedence and couldn't find anything that specifically answered the question. If I leave my code as the first example, will it come back to bite me later? or is the second example more correct?

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: a simple Java question
      • From: Farrukh Ijaz <email@hidden>
  • Prev by Date: Re: NSPropertyListSerialization dictionaryForJSONString/jsonStringFromPropertyList
  • Next by Date: Re: a simple Java question
  • Previous by thread: Re: NSPropertyListSerialization dictionaryForJSONString/jsonStringFromPropertyList
  • Next by thread: Re: a simple Java question
  • Index(es):
    • Date
    • Thread