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 ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.