11/18/11

Identifiers :In Java programming language, an identifier is a name given to a variable, class or method. Identifiers start with a letter, underscore(_) or dollar sign ($). The following characters can be digits. Identifiers are case sensitive and have no maximum length.

The following are valid Identifiers :

identifier

userName

user_name

_sys_var1

$change

Note :

Identifiers containing a dollar sign ($) are generally unusual, although languages like BASIC make extensive use of them. Its probably best to avoid using dollar sign ($). Keywords :

Keywords have special meaning to the Java compiler. They help in indentifying a data type name or program construct name.

Types :The Java programming language has many built in data types. These are classified into two broad categories

Class Types

Primitive Types

Primitive types are simple values and not objects. Class types are used for more complex types, includeing all types that we declare ourselves.

Primitive Types :

The java programming languagw has eight primitive data types :

Logical : boolean

Textual : char and String

Integral : byte, short, int and long

Floating point : double and float

Logical - boolean :Logical values are represented using the boolean type, which takes one of two values : true or false. The following code is an example of the declaration and initialization of a boolean type varialble :

// declares the variable truth as boolean and
// assigns it the value true
boolean truth=true;

Textual - char :

Single character are represented using a char type. A char represents a 16-bit, unsigned Unicode character.

'\a' The letter a
'\t' A tab
'\u????' A specific Unicode character, ????, is replaced with exactly four hexadecimal digits.

Textual - String :String type, its not a primitive type its a class type, used to represent a sequences of characters. The characters themselves are Unicode. Unlike C and C++, strings do not end with \0.
A String literal is enclosed in double quotes marks :

You can clear many of your doubts regarding Literals in Java through Merit Campus, visit: http://java.meritcampus.com/core-java-topics/literals-in-java, http://java.meritcampus.com/core-java-topics/floating-point-literals-in-java

Not only Literals, we also have each and every topic in Core Java with example for each. You can read lot of sessions and can write many practice tests in Merit Campus Java website. visit: http://java.meritcampus.com/core-java-topics/ to know more.

Hi, I am a big follower of your blog. Really very informative post you shared here. Keep sharing this type of informative blog. Waiting for your next update. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.