In this post i will explain the concept of Data Types in Java.
When we write a program we have to use some variables, constants etc and for using these variables we have to declare them first.
For declaring these variables there should be some datatype of that variable so that its storage can be determined.
So in Java there are following types of Data Type:
byte ==> 8 bits
short ==> 16 bits
int ==> 32 bits
long ==> 64 bits
2)Floating Point:This category contains float,double types.
float ==> 32 bits
double ==> 64 bits
3)Characters: This category contains char type.
char ==> 16 bits
4)Boolean:This type has 2 values true,false.
When we write a program we have to use some variables, constants etc and for using these variables we have to declare them first.
For declaring these variables there should be some datatype of that variable so that its storage can be determined.
So in Java there are following types of Data Type:
- Integers
- Floating Point Numbers
- Characters
- Boolean
byte ==> 8 bits
short ==> 16 bits
int ==> 32 bits
long ==> 64 bits
2)Floating Point:This category contains float,double types.
float ==> 32 bits
double ==> 64 bits
3)Characters: This category contains char type.
char ==> 16 bits
4)Boolean:This type has 2 values true,false.
0 comments:
Post a Comment