Data Types. Java defines the eight simple Data types: byte, short, int, long, char, float, double, and boolean. These eight types can be put in four main groups:

  • Integers
  • Floating
  • Characters
  • Boolean

Programmer can use these types to construct arrays or your own class types. The simple types show single values in programming. The simple types are defined to have an explicit range and mathematical behavior in programming languages. Languages such as C++ and C allow the integer size to vary based upon the dictates of the execution environment. Java is different from its portability requirement. all data types have specifically defined the range. For example, an int is always 32 bits (4 bytes), regardless of the particular platform.