Java data types based on Java

Java data types

Java data types include eight basic data types and reference types.


Eight basic data types

  1. byte 8th
  2. short 16 bits
  3. int 32 bit
  4. long 64 bit
  5. float 32 bit
  6. double 64位
  7. char Single 16-bit Unicode character
  8. boolean

When we use it, we don't need to memorize the binary digits of each data type, the stored maximum and minimum values, because their values ​​have been defined in the corresponding packaging class in the form of constants. For example, to query the binary number, directly call the SIZE method, the maximum value calls the MAX_VALUE method, and the minimum value calls the MIN_VALUE


Reference type

  1. Class
  2. Interface
  3. Array ([])

It should be noted that String is a reference type, because String is a class!

Finally, thank you for your support!

Published 5 original articles · praised 9 · visits 53

Guess you like

Origin blog.csdn.net/YeahToYeah/article/details/105457792