How You Identify the Identifiers and Varieties in Java Language

anas mhna
identifiers in Java are those names that are given for the different members of Java program like varieties ,functions and methods. The conditions, which have to be achieved by identifiers, are:

1- The identifier have to contain only numbers or alphabetical letters or under score .

2- The first symbol in the identifier have to be alphabetical letter. You can use under score, but it isn't usual to use it.

3- In contrast to under score, the identifier mustn't contain one of the special characters.

4- The small letters don't have the same value of the capital letters.

5- The identifier should be clear enough to understand what it indicates.

6- The first letter of any method name should be capital letter and consist of two wards. Unlike the first word, the second one begin with capital letter.

7- The object name start with capital letter. If it consists of two words, the two wards begin with capita letter.

• Right examples for identifiers:

X , area10 , Y15 , tax_rate , Sum_4 , total_value , REAL , Name_temperature.

• wrong examples for identifiers:

&address , last name , order-no , char , "a".

The symbols used in java language consist of :

1- The Alphabetical letters including capital letters (from A to Z) and small letters (from a to z).

2- The Digits involving numbers (from 0 to 9).

3- The Special characters, which aren't numbers or letters, represent the following symbols:

{ + - / * = % ! \ " ' . , ; ( ) [ ] ? < > : }.

We can use more than one symbol together. For example, "\n", which is a combined two symbols, represent a command that makes the consular move to a new line. This way of use symbols are known as "escape sequences" .

The reserved wards (or main words), that have been identified in Java language, have a special meaning and are just used for specific purposes, so you can't use them as varieties. These reserved wards are :

auto , extern , sizeof , break , if , float , static , case , struct , for , char , goto , switch , const , int , typeof , continue, union , do , default , long , register , void , double , else , return , volatile , short , while , enum , signed , near , asm , entry , fortran , huge , pascal , ada .

To comment, please sign in to your Yahoo! account, or sign up for a new account.