14 May 2022
14 May 2022
14 May 2022
Variable:
⚫ A variable provides identity to memory location ⚫
Using variables we can process the information easily ⚫
Variables can also be called as References & Identifiers
Understanding Identifier :
➢ A name in JAVA program is called identifier.
➢ It may be class name, method name, variable name.
Rules [8]:
✓ The only allowed characters in java identifiers are:
1) a to z
2) A to Z
3) 0 to 9
4) _(underscore) and $
✓ If we are using any other symbols we will get compile time error. ✓ We
can’t start a JAVA Identifier with number.
✓ Java Identifiers are case sensitive (Actually JAVA itself is a case sensitive) ✓
We can take our own length for the name of an JAVA identifier. ✓ We can’t use
JAVA language keywords (50) as identifiers.
✓No space is allowed between the characters of an identifier ✓ All
predefined JAVA class names and interface names we can use as identifiers (X)