Data types in Java, primitive types, Java environment variables, Types of variables in java with examples and sample programs. What Are Data Types In Java? [wp_ad_camp_3] Data Types In Java: Before we using a variable, we should specify what type (datatype) of variable it is. Because, when we specify the datatype, the system can understand Java supports eight basic primitive data types. This tutorial explains basic primitive data types (int, long, short, byte, char, boolean, float, double) with their size, range and default value. Java basic data types are predefined and implicit to the language. The term data type refers to the type of data that can be stored in a variable. Sometimes, Java is called a “strongly typed language” because when you declare a variable, you must specify the variable’s type. Then the compiler ensures that you don’t try to assign data of the wrong type to the variable.