OCP EXAM OBJECTIVES COVERED IN THIS CHAPTER:
- Using Operators and Decision Constructs
- Use Java operators including the use of parentheses to override operator precedence
- Working With Java Primitive Data Types and String APIs
- Declare and initialize variables (including casting and promoting primitive data types)
In the previous chapter, we talked a lot about defining variables, but what can you do with a variable once it is created? This chapter introduces operators and shows how you can use them to combine existing values and create new values. We’ll show you how to apply operators to various primitive data types, including introducing you to operators that can be applied to objects.