Basic Datatypes

0
9

This java tutorial is all aboutBasic Data types
Basic Datatypes

In java there are two types of data types:
1. Primitive data types:System defined data types are called primitive data types.
1. byte: Its bit-size is 8 bits.eg. byte a=10;
2.short: Its bit-size is 16 bits.eg. Short a=1000;
3.int:   It is applied for integers.Its bit-size is 32 bits. eg. int a=10000;
4.long:  It is applied for large integer numbers.Its bit-size is 64 bits.eg. long a=100000;
5.float:  It is applied for fractional numbers with small range.Its bit-size is 32 bits.eg. float a=26.78;
6.double:  It is applied for fractional numbers with wide range values.Its bit-size is 64 bits.eg. double x=0.00007348739329;
7.char:  It is applied for a single character.Its bit-size is 16 bits.eg.char x=’L’;
8.boolean:  It contains a two possible values true or false.The default value is false.eg.boolean a=true;

2. Non-Primitive data types-These are derived from the primitive data types.eg.arrays,classesetc.

Facebook Comments
(Visited 10 times, 1 visits today)

LEAVE A REPLY

Please enter your comment!
Please enter your name here