Sams Teach Yourself C in 21 Days

(singke) #1
Java Language Fundamentals 707

BD4


try
Declaration modifiers abstract
final
private
protected
public
static
Used with classes and methods class
extends
implements
import
instanceof
interface
native
package
throws
transient
volatile
Reserved for future use const
goto

Java Identifiers ....................................................................................................


Anidentifieris a name that you supply for a variable, class, or other program element.
Java is very flexible when it comes to identifiers. They can be any length and can contain
letters, the underscore character, the dollar sign character, and the digits 0 through 9
(although the first character of an identifier cannot be a digit). By letters, Java does not
mean only the 26 characters of the English alphabet, but all the thousands of characters
from various languages that are represented in the Unicode character set. To be specific,
all Unicode characters above hex value 00C0can be used in a Java identifier. Here are
some examples:
interestRate
$_9
ø9ú
As with any language, you cannot use keywords as identifiers. Also, it is wise program-
ming practice to use identifiers that describe the item they refer to. In the list above, the
first identifier adheres to this rule. The other two, although perfectly legal, break the rule
and should be avoided.

TABLEB4.1 continued
Category Keywords

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

Free download pdf