Opening Hours :7AM to 9PM
Datatypes are used to identify the type of data or which allocates the sufficient memory space for the Variable.
These Datatypes are classified into following types:
1 Primitive Datatypes
2.Derived Datatypes
3.User Defined Datatypes
Primitive datatypes are used to store the single value at a time
int x=10; int y=10,20;(invalid)
In java language these Primitive datatypes are classified into following types
1.Integer Datatype
2.Floating Point Datatype
3.Character Datatype
4.Boolean Datatype
Note: In C-language character datatype occupies one byte of memory because it supports ASCII code(American Standard Code for Information Interchange ).It contains 256 characters only.
So character datatype occupies one byte of memory.
In java language character datatype occupies two bytes of memory because it supports UNI Code(Universal Coding System).It contains 18 international languages.each language contains their own alphabets and symbols and numbers.Each characters contains one unique value.So java language character datatype occupies 2 bytes of memory
ASCII Codes:
A - 65
a - 97
0 - 48
These are used to store the more than one value similar type
int marks[]={10,20,30,40,50}; char x[]={'a','b','c','d'};
These are used to store the more than one value dissimilar type
class Demo
{ int x; float y; char z; }