Sunday, February 8, 2009

Java Identifiers

A name in a java Program is called an Identifier.Which can be used for representing classes,methods , variables and labels.
Rules:
1.Java Identifier is composed of a sequence of charaters,Which each charater may be a letter from a to b or A to B or digit from 0 to 9 or currency symbol ($) or connecting symbol (_).If we use other charater we will get commpail time error saying illegal charater.
2.No identifier starts with the digit.
3.There is no length limit for java identifier ,but SUN highly recommened upto 15 charaters .
4.Identifier in java are casesensitive.
5.we are not allowed to use reserved words as identifier.
6.All predefined java class names ,you are allowed to use as identifiers.
Examples:
Total (√)
total123 (√)
123total (×)
total$ (√)

_total (√)
total# (×)
total_numbers (√)
total-numbers (×)

1 comments:

Anonymous said...

char...

Post a Comment