Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.03 KB

README.md

File metadata and controls

43 lines (35 loc) · 1.03 KB

Primitive data types and Wrapper Classes

Primitive data types

  • byte
  • short
  • int
  • long
  • float
  • double
  • boolean
  • char

Wrapper Classes

  • Byte
  • Short
  • Integer
  • Long
  • Float
  • Double
  • Boolean
  • Character

Autoboxing and Unboxing

  • Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding
  • object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion
  • goes the other way, this is called unboxing.
  • The following table lists the primitive types and their corresponding wrapper classes, which are used by the Java compiler
  • for autoboxing and unboxing:
Primitive Type Wrapper Class
boolean Boolean
char Character
byte Byte
short Short
int Integer
long Long
float Float
double Double