A character can be stored in memory using its ASCII Code. ASCII means American System of Computer Information Interchange. Here is a Table of ASCII Codes.
Actually, Java uses the Unicode system for storing characters which includes the ASCII codes as a subset. For more information on Unicode, see this link: http://www.unicode.org.
Here are the Java escape sequences:
Escape Sequence | Meaning |
---|---|
\b | backspace |
\f | form feed |
\n | line feed |
\r | carriage return |
\t | tab |
\" | double quote |
\' | single quote |
\\ | backslash |
Variable initialization in declaration:
Datatype | Meaning | Size in Bytes | Min Value | Max Value | Sig. Digits |
---|---|---|---|---|---|
int | Integer | 4 | -2 billion | 2 billion |   |
double | Floating Point | 8 | -1.8x10308 | 1.8x10308 | 15 |
char | Character | 2 | Any Unicode character |   | |
boolean | Logical | 1 | false | true |   |
The string declaration
String item = "apple";
is short for the object declaration
String item = new String("apple");