410 likes | 546 Views
Primitives, Identifiers and Literals. Primitive Data Types. Primitive data types. Boolean type. Numeric types. Primitive Data Types. Primitive data types. Boolean type. Numeric types. boolean. Primitive Data Types. Primitive data types. Boolean type. Numeric types. Integral Types.
E N D
Primitive Data Types Primitive data types Boolean type Numeric types
Primitive Data Types Primitive data types Boolean type Numeric types boolean
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types boolean
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean char
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean char byte short int long
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean char byte short int long float double
Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean char byte short int long float double
Primitive Data Types boolean char byte short int long float double
Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b
Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b ‘t’, not “t”
Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b ‘t’, not “t” UTF-16
Primitive Data Types byte short int long float double boolean char 8b 16b 32b 64b 32b 64b 16b
Java Primitive Data Types boolean integral floatingpoint character numeric boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Identifiers Identifiers cannot start with a number!
Identifiers Legal Indentifiers Bingosum_$ $43next 변수5
Identifiers Illegal Identifiers! 25draw baby@cry Grand-sum
Identifiers Identifiers cannot start with a number! 25draw baby@cry Grand-sum
Java Primitive Data Types boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Java Primitive Data Types true boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Java Primitive Data Types false boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Java Primitive Data Types ‘a’ boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Java Primitive Data Types 2147483647 boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
Java Primitive Data Types 3.14 boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-
New in Java SE 7 2_147_483_647
New in Java SE 7 21_4748_3647
New in Java SE 7 0b0101
New in Java SE 7 0b1101_0011
Literals F, f, L, l suffixes
Literals Long x = 2147483647;
Literals Long x = 2147483648;
Literals Long x = 2147483648L;
Literals Long x = 2147483648l;
Literals Double x = 3.56;
Literals Float x = 3.56;
Literals Float x = 3.56F;
Literals Float x = 3.56f;
Literals • Octal and Hexadecimal • Octal: prefix zero • Hex: prefix zero and x • int x = 025; • int y = 0x3a;