Meses

desde que no estas experimente las formas en las que se puede partir un alma. “Para papá (aldo)” is published by Mariana Paula Maresca.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Data Types in java

In java every variable and every expression has some type. Each and every data type is clearly defined. Every assignment should be checked by type compatibility, because of this reasons java is strongly typed programming language.

Java is not pure object oriented programming language because several oops features(like operator overloading and multiple inheritance ..etc) are not present.

Moreover java is dependent on premitive data types.

Integral data types -

a. byte

b. short

c. int

d. long

Floating point data types-

a. float

b. double

a. char

b. boolean

Except boolean and char remaining data types are considered as signed data types because we can represent both positive and negative number.

size = 1 byte(8 bits)

Positive number will be represented directly in the memory where as negative number will be represented in two’s complement form.

byte is the best choice if we want to handle data in terms of steams either from the file or from the network (file supported or network supported is the byte).

size=2 bytes(16 bits)

Range: -2¹⁵ to +2¹⁵-1

-32768 to 32767

size= 4 bytes (32 bits)

Range : -2³¹ to 2³¹-1

size = 8 bytes (64 bits)

Range : -2⁶³ to 2⁶³-1

size= 4 bytes

Range: -3.4×10³⁸ to 3.4×10³⁸

size = 8 bytes

Range : -1.7×10³⁰⁸ to 1.7×10³⁰⁸

size = NA(VM dependent)

Range : NA(allowed values are true/false)

size = 2 bytes (16 bits)

Range : 0 to 65535

Note — char uses 2 bytes because it has unicode characters.

All data types have their corresponding wrapper classes.

Add a comment

Related posts:

Dear Democritus.

To my teacher who cared the most.. “Dear Democritus.” is published by Allen Liao 廖晉德.

Samuel Brozina Delves Into Revolutionary War Timeline

A licensed pilot and former Revolutionary War reenactor, Samuel Brozina, a graduate of Cumberland County College from Millville, New Jersey, delves into the famous war’s timeline from 1775 to 1783…

The Death of Higher Education

Google recently announced that they would be offering $300 certifications that when completed, would be considered on par with a college degree by their hiring managers. Please let that statement…