Appendix D. Java Keywords


[Page 829]

The words shown in Table D.1 are reserved for use as Java keywords and cannot be used as identifiers. The keywords const and goto are C++ keywords. They are not actually used in Java but were included to enable better error messages to be generated when they are mistakenly used in a Java program.

Table D.1. Java keywords cannot be used as names for identifiers

abstract

continue

for

new

switch

assert

default

goto

package

synchronized

boolean

do

if

private

this

break

double

implements

protected

throw

byte

else

import

public

throws

case

enum

instanceof

return

transient

catch

extends

int

short

try

char

final

interface

static

void

class

finally

long

strictfp

volatile

const

float

native

super

while


The words true, false, and null may look like keywords but are technically considered literals. They too cannot be used as identifiers.




Java, Java, Java(c) Object-Orienting Problem Solving
Java, Java, Java, Object-Oriented Problem Solving (3rd Edition)
ISBN: 0131474340
EAN: 2147483647
Year: 2005
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net