Java Data Types Explained – Primitive and Non-Primitive
Data Types in Java: Introduction In Java programming , data types play a very important role. A data type defines the type of value a variable can store. For example, some variables store numbers, some store characters, and some store true/false values. Types of Data Types in Java In Java, data types are mainly divided into two categories : Primitive Data Types Non-Primitive (Reference) Data Types 1. Primitive Data Types in Java Primitive data types are the basic built-in data types provided by Java and used to store simple values like numbers, characters, and true/false values. They are not objects and store actual values directly in memory , which makes them fast and memory efficient . Java has 8 primitive data types . Data Type Description ...