002 basic data type

Basic data type

  1. Integer byte short int long
  2. Float double
  3. Character char
  4. Boolean boolean
    notes:
  5. String is not a basic data type, but a reference type
  6. Floating point may only be an approximate value, not an exact value
  7. The data range is not necessarily related to the number of bytes. The float data range is more extensive than long, but float is 4 characters, and long is 8 bytes
  8. The default type of floating-point numbers is double. If you must use float, you need to add a suffix F; if it is an integer, the default is int type. If you must use the long type, you need to add a suffix L. Capital letter suffix is ​​recommended.

Guess you like

Origin blog.csdn.net/eightNine1102/article/details/107238728