Pro-Sequence
LeetCode
CodeChef
CodeForces
HackerEarth
Placement
Tutorial
Blogs
Codes
CPA
Recently visited pages.
×
Tutorials
Java
Data-Types-in-Java
Introduction
Features of Java
Cpp vs Java
Hello Word java program
Difference between JDK JRE and JVM
Java Variables
Data Types in Java
Unicode System
Operators in Java
Java Keywords
If else Statement
Java Switch Statement
OOPs Concepts
Written by -
Yash Agrawal
Data Types in Java
Data types define different size and values that can be stored in the memory and according to that we can apply certain operations.
Types:
Primitive data types:
This includes char, float, int, boolean, byte short, long, double.
Non-primitive data types:
This includes Classes, Interfaces, Arrays.
Primitive Data Type:
This is the most basics ones. There are 8 types of primitive data types:
boolean data type
char data type
byte data type
float data type
long data type
int data type
double data type
short data type
Data Type
Default Value
Default size
boolean
false
1 bit
char
'\u0000'
2 byte
byte
0
1 byte
short
0
2 byte
int
0
4 byte
long
0L
8 byte
float
0.0f
4 byte
double
0.0d
8 byte
Non - Primitive Data Type
This contains strings(array of characters), classes and interfaces, these are more complex then primitive data types.
More Tutorials
Java
Memcached
C
Reactjs
BootStrap4
Rust