Q 21 - Data Types #25
Answered
by
HARSHITH-MV
AmjustGettingStarted
asked this question in
Q&A
-
What are the different data types in Java? 🤔 |
Beta Was this translation helpful? Give feedback.
Answered by
HARSHITH-MV
Jul 18, 2025
Replies: 1 comment
-
📊 Java Data TypesJava data types are divided into two main categories: 1️⃣ Primitive Data TypesThese are the most basic types built into the language.
2️⃣ Non-Primitive (Reference) Data TypesThese refer to objects and arrays.
🧠 Quick Tips
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
AmjustGettingStarted
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
📊 Java Data Types
Java data types are divided into two main categories:
1️⃣ Primitive Data Types
These are the most basic types built into the language.
byte
byte b = 10;
short
short s = 100;
int
int i = 1000;
long
long l = 10000L;
float
float f = 10.5f;
double
double d = 20.99;
char
char c = 'A';
boolean
boolean b = true;
2️⃣ Non-Primitive (Reference) Data Types
These refer to objects and arrays.