Page 785 - Introduction to Programming with Java: A Problem Solving Approach
P. 785

                  APPENDIX 3
   Java Reserved Words
Java reserved words are words you cannot use for the name of anything you define because they already have special meanings. Most of these words are keywords—they play particular roles in a Java program. An asterisk indicates that the word in question is not used in the body of this text.
 abstract—not realizable. This is a modifier for classes and methods and an implied modifier for interfaces. An abstract method is not defined. An abstract class contains one or more abstract methods. All of an interface’s methods are abstract. You cannot instantiate an interface or abstract class.
assert*—claim something is true. Anywhere in a program, you can insert statements saying assert <boolean-expression>; Then if you run the program with the option, enableassertions, the JVM
Figure A3.1a Reserved words—part A
Apago PDF Enhancer
throws an AssertionError exception when it encounters an assert that evaluates to false. boolean—a logical value. This primitive data type evaluates to either true or false.
break—jump out of. This command causes execution in a switch statement or loop to jump forward to the first statement after the end of that switch statement or loop.
byte—8 bits. This is the smallest primitive integer data type. It is the type stored in binary files. case—a particular alternative. The byte, char, short, or int value immediately following the case
keyword identifies one of the switch alternatives.
catch—capture. A catch block contains code that is executed when code in a preceding try block
throws an exception, which is a special object that describes an error.
char—a character. This is a primitive data type that contains the integer code number for a text character or
any other symbol defined in the Unicode standard.
class—a complex type. This block of Java code defines the attributes and behavior of a particular type of object. Thus, it defines a data type that is more complex than a primitive data type.
const*—a constant. This archaic term is superceded by final.
continue*—skip to end. This command causes execution in a loop to skip over the remaining statements in the loop’s code and go directly to the loop’s continuation condition.
751
















































































   783   784   785   786   787