Beginning Programming with Java For Dummies (For Dummies (Computers)) by Burd Barry A

Beginning Programming with Java For Dummies (For Dummies (Computers)) by Burd Barry A

Author:Burd, Barry A. [Burd, Barry A.]
Language: eng
Format: epub
ISBN: 9781119235569
Publisher: Wiley
Published: 2017-06-27T16:00:00+00:00


In Figure 10-8 , notice that the y and Y inputs yield different ticket prices, even though the age is 85 in both runs. This happens because, without parentheses, any && operator gets evaluated before any || operator. (That’s the rule in the Java programming language — evaluate && before || .) When reply is Y , the condition in the bad if statement takes the following form:

reply == ’Y’ || some-other-stuff-that-does-not-matter

Whenever reply == ’Y’ is true , the whole condition is automatically true , as illustrated in Figure 10-9 .

FIGURE 10-9: “True or false” makes “true.”



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.