1 / 41

Primitives, Identifiers and Literals

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.

Download Presentation

Primitives, Identifiers and Literals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Primitives, Identifiers and Literals

  2. Primitive Data Types Primitive data types Boolean type Numeric types

  3. Primitive Data Types Primitive data types Boolean type Numeric types boolean

  4. Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types boolean

  5. Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean

  6. Primitive Data Types Primitive data types Boolean type Numeric types Integral Types Floating-point types Character type Integer types boolean char

  7. 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

  8. 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

  9. 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

  10. Primitive Data Types boolean char byte short int long float double

  11. Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b

  12. Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b ‘t’, not “t”

  13. Primitive Data Types boolean char byte short int long float double 16b 8b 16b 32b 64b 32b 64b ‘t’, not “t” UTF-16

  14. Primitive Data Types byte short int long float double boolean char 8b 16b 32b 64b 32b 64b 16b

  15. Java Primitive Data Types boolean integral floatingpoint character numeric boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  16. Identifiers

  17. Identifiers Identifiers cannot start with a number!

  18. Identifiers Legal Indentifiers Bingosum_$ $43next 변수5

  19. Identifiers Illegal Identifiers! 25draw baby@cry Grand-sum

  20. Identifiers Identifiers cannot start with a number! 25draw baby@cry Grand-sum

  21. Literals

  22. Java Primitive Data Types boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  23. Java Primitive Data Types true boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  24. Java Primitive Data Types false boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  25. Java Primitive Data Types ‘a’ boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  26. Java Primitive Data Types 2147483647 boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  27. Java Primitive Data Types 3.14 boolean char byte short int long float double 16 + 8 +/- 16 +/- 32 +/- 64 +/- 32 +/- 64 +/-

  28. New in Java SE 7 2_147_483_647

  29. New in Java SE 7 21_4748_3647

  30. New in Java SE 7 0b0101

  31. New in Java SE 7 0b1101_0011

  32. Literals F, f, L, l suffixes

  33. Literals Long x = 2147483647;

  34. Literals Long x = 2147483648;

  35. Literals Long x = 2147483648L;

  36. Literals Long x = 2147483648l;

  37. Literals Double x = 3.56;

  38. Literals Float x = 3.56;

  39. Literals Float x = 3.56F;

  40. Literals Float x = 3.56f;

  41. Literals • Octal and Hexadecimal • Octal: prefix zero • Hex: prefix zero and x • int x = 025; • int y = 0x3a;

More Related