Professional Documents
Culture Documents
Data Types Keywords Identifiers
Data Types Keywords Identifiers
Data Types Keywords Identifiers
KEYWORDS,
IDENTIFIERS
Java Keywords
Below are Java keywords. They have
specific usage in Java and should not be
used as identifiers. abstract default if private this
boolean do implements protected throw
break double import public throws
byte else instanceof return transient
case extends int short try
catch final interface static void
char finally long strictfp volatile
class float native super while
const for new switch
continue goto package synchronized
Java Keywords
All of these keywords are in small
letters or lowercase. Remember that
Java is case-sensitive. Capitalizing
any letter of a keyword will convert it
to an identifier.
Identifiers
Identifiers are names supplied by programmers for classes, methods,
constants and variables.
Rules to follow:
• An identifier's first character can be a Unicode letter, a dollar sign
($), or an underscore (_). The rest can be underscores and
alphanumeric characters. Special characters are not allowed.
• There is no restriction on the length of identifiers. To take
advantage of this, make your identifiers as descriptive as possible
of their purpose.
• Capitalize the beginning of each succeeding word of the identifier
if it is made up of several words. There should be no spaces in an
identifier.
• Do not use Java keywords as identifiers.
Identifiers
Example:
static final long SpeedOfLight=299792458;
Activity
Fill in the blanks:
Below is a program that prints your name and birthday on the
screen. Fill-in the missing portions.
/* Name of program: myName.java
Made by: _________________
____
package ________________;
public class ______________{
public _____________ main (String___ args)
{
System.out.println("_____________");
___________________("___________");
}
}