C.1. Introduction
In this appendix, we discuss the theory and principles of structured programming. The concepts presented here are crucial in building classes and manipulating objects. We introduce Java’s compound assignment, increment and decrement operators, and we discuss the portability of Java’s primitive types. We demonstrate Java’s for, do...while and switch statements. Through a series of short examples using while and for, we explore the essentials of counter-controlled repetition. We create a version of class GradeBook that uses a switch statement to count the number of A, B, C, D and F grade equivalents in a set of numeric grades entered by the user. We introduce the break and continue program-control statements. We discuss Java’s ...
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