Sams Teach Yourself C in 21 Days

(singke) #1

Java Keywords ....................................................................................................


Like all programming languages, Java has a set of keywordsthat are the core of the lan-
guage. You cannot use keywords as identifiers, such as variable names, in your programs.
Java has more keywords than C (Java has about 50 keywords), but still that is a manage-
able number. A few of the keywords are not actually used yet, but have been reserved for
possible future use. Table B4.1 lists the Java keywords, organizing them by category. Of
course, you do not yet know what most of these keywords mean. You’ll learn about most
of them, however, in this and the next two bonus days.

TABLEB4.1 Java language keywords
Category Keywords
Built-in data types boolean
byte
char
double
float
int
long
short
strictfp
widefp
void
Used in expressions new
this
super
Used in selection statements break
case
default
else
if
switch
Used in iteration statements continue
do
for
while
Used in other statements catch
finally
return
synchronized
throw

706 Bonus Day 4

39 448201x-Bonus4 8/13/02 11:19 AM Page 706

Free download pdf