Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 12. How Do I Test Several Things... > The Order of Logical Operators

The Order of Logical Operators

Because logical operators appear in the order of operators table, they have priority at times, just as the other operators do. Studying the order of operators will show you that the && operator has precedence over the ||. Therefore, the following logic

if (age < 20 || sales < 1200 && hrsWorked > 15) {


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial