ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

Basic Datatypes

 

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

Check Your Domain Ranking

Updated: January 31, 2016 — 1:31 am

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!