O'Reilly logo

Java SE 7 Programming Essentials by Michael Ernest

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Using Java Operators and Conditional Logic

The fundamental unit of work in a Java program is the statement. To write useful statements, you must learn how to operate on your data. To write accurate statements, you must also learn the rules of the operation themselves. There is no substitute for understanding Java’s operators very well. Your primary reward is a big one: You’ll spend less time getting your code to do the right thing. Once your statements evaluate correctly, you’ll need to test them and make sure all the decisions based on those statements evaluate as they should.

In this chapter, we’ll cover the following topics:

  • Using Java operators
  • Using parentheses to control operators
  • Understanding object equality
  • Using if and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required