Chapter 2. Programs, Data, Variables, and Calculation
In this chapter you'll look at the entities in Java that are not objects—numbers and characters. This will give you all the elements of the language you need to perform numerical calculations, and you'll apply these in a few working examples.
In this chapter you'll learn:
How to declare and define variables of the basic integer and floating-point types
How to write an assignment statement
How integer and floating-point expressions are evaluated
How to output data from a console program
How mixed integer and floating-point expressions are evaluated
What casting is and when you must use it
What boolean variables are
What determines the sequence in which operators in an expression are executed
How to include comments in your programs
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access