Basic types of knowledge points

Basic types of knowledge points

Integer type

  • byte
  • shrot
  • int
  • long

floating point type

  • float
  • double

character type

  • char

Summary of knowledge points

  • Primitive types are stored on the stack

  • Byte short char operations will be converted to int type

Unboxing and packing

Basic data types correspond to wrapper classes

Integer type

  • Byte
  • Shrot
  • Integer
  • Long

floating point type

  • Float
  • Double

character type

  • Character

Summary of knowledge points

  • Primitive types can be passed ==, or ! = make a conditional judgment

  • Byte is the wrapper type of byte, initialized to null instead of 0;

  • intValue() is the basic data type that turns the Integer object type into an int;

  • parseInt() is the basic data type that turns String into int;

  • Valueof() converts String to Integer object type; (now the JDK version supports automatic boxing and unboxing.)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325067875&siteId=291194637