Java Reference
In-Depth Information
abstract
assert
boolean
break
byte
case
catch
char
class
const *
continue
default
do
double
else
enum
extends
false
final
finally
float
for
goto *
if
implements
import
instanceof
int
interface
long
native
new
null
package
private
protected
public
return
short
static
strictfp
super
switch
synchronized
this
throw
throws
transient
true
try
void
volatile
while
FIGURE 1.18
Java reserved words
Therefore, total , label7 , nextStockItem , NUM_BOXES , and $amount are all
valid identifiers, but 4th_word and coin#value are not valid.
Both uppercase and lowercase letters can be used in an identifier, and the dif-
ference is important. Java is case sensitive, which means that two identifier names
that differ only in the case of their letters are considered to be different identifiers.
Therefore, total , Total , ToTaL , and TOTAL are all different identifiers. As you can
imagine, it is not a good idea to use multiple identifiers that differ only in their
case, because they can be easily confused.
Identifier
Java Letter
Java Letter
Java Digit
An identifier is a letter followed by zero or more letters and digits.
A Java Letter includes the 26 English alphabetic characters in both
uppercase and lowercase, the $ and _ (underscore) characters, as well
as alphabetic characters from other languages. A Java Digit includes
the digits 0 through 9 .
Examples:
total
MAX_HEIGHT
num1
Keyboard
System
 
Search WWH ::




Custom Search