Question:

What are the Data Types supported by Java ? What is Autoboxing and Unboxing ?

Answer:

The eight primitive data types supported by the Java programming language are:

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

Autoboxing is the automatic conversion made by the Java compiler between the primitive types and their corresponding object wrapper classes. For example, the compiler converts an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this operation is called unboxing.


Keywords:

© 2017 QuizBucket.org