Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners what is a indentifier
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Chris Scott
what is a indentifier
2 Answer(s)      6 years and 2 months ago
Posted in : Java Beginners



Advertisement
View Answers

September 29, 2008 at 10:25 AM


An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. An identifier cannot have the same spelling (Unicode character sequence) as a keyword, boolean literal, or the null literal.

Identifier:
IdentifierChars but not a Keyword or BooleanLiteral or NullLiteral

IdentifierChars:
JavaLetter
IdentifierChars JavaLetterOrDigit

JavaLetter:
any Unicode character that is a Java letter (see below)

JavaLetterOrDigit:
any Unicode character that is a Java letter-or-digit (see below)

Letters and digits may be drawn from the entire Unicode character set, which supports most writing scripts in use in the world today, including the large sets for Chinese, Japanese, and Korean. This allows programmers to use identifiers in their programs that are written in their native languages.
A "Java letter" is a character for which the method Character.isJavaIdentifierStart(int) returns true. A "Java letter-or-digit" is a character for which the method Character.isJavaIdentifierPart(int) returns true.

The Java letters include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character should be used only in mechanically generated source code or, rarely, to access preexisting names on legacy systems.

The "Java digits" include the ASCII digits 0-9 (\u0030-\u0039).

Two identifiers are the same only if they are identical, that is, have the same Unicode character for each letter or digit.

Identifiers that have the same external appearance may yet be different. For example, the identifiers consisting of the single letters LATIN CAPITAL LETTER A (A, \u0041), LATIN SMALL LETTER A (a, \u0061), GREEK CAPITAL LETTER ALPHA (A, \u0391), CYRILLIC SMALL LETTER A (a, \u0430) and MATHEMATICAL BOLD ITALIC SMALL A (a, \ud835\udc82) are all different.

Unicode composite characters are different from the decomposed characters. For example, a LATIN CAPITAL LETTER A ACUTE (, \u00c1) could be considered to be the same as a LATIN CAPITAL LETTER A (A, \u0041) immediately followed by a NON-SPACING ACUTE (, \u0301) when sorting, but these are different in identifiers. See The Unicode Standard, Volume 1, pages 412ff for details about decomposition, and see pages 626-627 of that work for details about sorting. Examples of identifiers are:

String
i3
MAX_VALUE
isLetterOrDigit



Rajanikant


September 29, 2008 at 11:02 AM


Hi friend,

Identifiers are the names of variables, methods, classes, packages and interfaces. In the HelloWorld program, HelloWorld, String, args, main and println are identifiers.

Identifiers must comply with these rules:

* The first character of an identifier must be a letter, an underscore(_), or a dollar sign($).
* The rest of the characters in the identifier can be a letter, underscore, dollar sign, or digit. Note that spaces are NOT allowed in identifiers.
* Identifiers are case-sensitive. This means that age and Age are different identifiers.
* Identifiers cannot match any of Java's reserved words.

Examples:

These identifiers are valid:

MyClass
$amount
totalGrades;
TotalGrades;
TAX_RATE
one

These identifiers are NOT valid:

My Class // spaces are not allowed
numberOf*s // the asterisk cannot be used
final // final is a reserved word
1Way // identifiers cannot start with a digit


--------------------------------------------------------------------


Visit for more information.

http://www.roseindia.net/java/

Thanks

Amardeep.


Related Tutorials/Questions & Answers:
what is a indentifier - Java Beginners
what is a indentifier  What is an identifier and what is the definition?  An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter. An identifier cannot
what is bit
what is bit  what is bit
Advertisements
What is procedure
What is procedure  What is procedure in computers? What are the primary categories of procedures
what are indices?
what are indices?  what are indices
what is collections?
what is collections?  what is collections
What is this keyword?
What is this keyword?  What is this keyword
what is Savepoint ?
what is Savepoint ?  what is Savepoint
What is a "constraint"?
What is a "constraint"?  What is a "constraint
What is Index?
What is Index?  What is Index
What is SQLLoader?
What is SQLLoader?  What is SQLLoader
What is DML?
What is DML?  What is DML
What is an interface?
What is an interface?  What is an interface
What's PHP ?
What's PHP ?  What's PHP
What is VLR ?
What is VLR ?  hii, What is VLR
What is Trigger?
What is Trigger?  What is Trigger
What is ActionServlet?
What is ActionServlet?  What is ActionServlet
What is FBT
What is FBT   hello, What is FBT
What is JDBC?
What is JDBC?  What is JDBC
What is a transaction and what are ACID properties?
What is a transaction and what are ACID properties?  What is a transaction and what are ACID properties
What is an Abstract Class and what is it's purpose?
What is an Abstract Class and what is it's purpose?   Hi, What is an Abstract Class and what is it's purpose? Thanks
What is DataAccessException?
What is DataAccessException?  Hi, What is DataAccessException? thanks
What is IOC ?
What is IOC ?  HI, What is IOC or Dependency Injection? Thanks
What is SQLExceptionTranslator?
What is SQLExceptionTranslator?  Hi, What is SQLExceptionTranslator? Thanks
What is Externalizable?
What is Externalizable?   Hi, What is Externalizable? Thanks
What is the % operator?
What is the % operator?   Hi, What is the % operator? thanks
What is casting?
What is casting?   Hi, What is casting? thanks
What are Struts?
What are Struts?  What are Struts? Can anyone explain me what are the Struts framework and what are its uses? Thanks
What is WAP?
What is WAP?  What is WAP?   Hi, Check the tutorial: What is WAP? Thanks
What is CRM?
What is CRM?  Can anyone tell me What is CRM? Thanks
what is RUP?
what is RUP?  hello, what is RUP??   hii, RUP is stands for Rational Unified Process
What is a tuple?
What is a tuple?  What is a tuple?   hi, A tuple is an instance of data within a relational database. Thanks
 

 

 

DMCA.com