Basic Datatypes


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 byte a=10;
2.short: Its bit-size is 16 Short a=1000;   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 long a=100000;
5.float:  It is applied for fractional numbers with small range.Its bit-size is 32 float a=26.78;
6.double:  It is applied for fractional numbers with wide range values.Its bit-size is 64 double x=0.00007348739329;
7.char:  It is applied for a single character.Its bit-size is 16 x=’L’;
8.boolean:  It contains a two possible values true or false.The default value is a=true;

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.