Data types in Java | Core Java Tutorials

This Core Java Tutorials “Data types in Java” post is giving an introduction to data types in java application including classification of data types, definition and need to data type.


 

Data types:

  • In the declaration of every variable, it is mandatory to represent its data type.

Syntax:

Data_type  <variable_name> ;

 

Why data type?

  • Represents how much memory is required to hold the data.
  • Represents what type of data is allowed.

 

Classification:

  • Java data types classified into 2 types
  • Primitive data types and user defined.
  • Class is the user-defined data type
  • User defined data types are reference(object) type in java application.

 

Java Data types

Share this