Java is statically typed language, we always need to define a keyword, which type of the variable is and that keyword is called DataType. We declare data type before a variable. For example, int x; here int is an integer data type. Data types specify the different sizes and values that can be stored in the variable. In the last tutorial, we have seen the  Java Collections example.

However, there are two types of data types in Java.

  1. Primitive data types
  2. Non-Primitive Data Types

Java Data Types Tutorial

Once a variable is declared to be of a certain data type, it cannot hold the values of other data types. Example: C, C++, Java. Other, Dynamically typed languages: These programming languages can receive different data types over time. Ruby, PythonJavascript, etc.

Now we will discuss these two data types.

#java #python #javascript #c++

Java Data Types Example | Data Types in Java Explained
2.65 GEEK