You are here: Home / Topics / Variable and Data Type in Java

Variable and Data Type in Java

Filed under: Java Tutorial on 2024-03-01 20:43:00

Variable
Variables occupy the memory to store data for a particular time.
 

Data Type
 

A data type is used to identify the size and type of information stored in a variable. Data types help in memory management. It helps to assign the
memory depending upon the type of data type. Most importantly Java has numerous data types and all data types are predefined, which is used to store a large amount of information. There are two main categories of data types primitive and non-primitive which classified the various data type. The following diagram classifies the primitive data types and non-primitive data types:

Primitive Data Types:

  1. int
  2. byte
  3. short
  4. float
  5. double
  6. boolean

Non-primitive Data Types:

  1. String
  2. Arrays
About Author:
J
Java Developer     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.