Data Types in Java:-
These are used to specify the Type of data .that we store in the memory location..
there are three [3] types of data types available in java such as:
1) Primitive data types
2) Derived data types.
3)User Defined datatypes.
Primitive Data type:-
These are pre-defined data types which are used for storing Single Values..
These are also called as Fundamental data types..
Under this category there are 8 types of which are classified into 4 categories..
such as:
1) integer category
2) Floating point
3) Character
4)Boolean.
Byte,short, int,long come under integer category.
all data types are meant for storing purpose..but their sizes and ranges are different..
Float,Double come under floating point category..
we call character in c and c++..but in java we call as String..
In boolean we have only true or false..
Type Casting:-
"The process of converting a value from 1 primitive data type to the other is called type casting.."
there are 2 types.
1) Implicit type casting
2) Explicit type casting.
Implicit type casting:-
The process of converting a primitive type value to the target type automatically is called implicit type casting..
Explicit Type casting:-
The process of converting primitive value to the target type only by specifying the target type explicitly is called explicit type casting...
Variables:-
It is an Identifier given to the memory location..The value of variable can be modified..
Declaration of Variable:-
The process of specifying the type of value that we store into memory location..is called variable declaration..
No comments:
Post a Comment