티스토리 뷰



Primitive Data Types

Data Type

 Size

 Description 

 byte

 1 byte (8-bit)

 -128 to 127

 short

 2 bytes 

 -32,768 to 32,767

 int

 4 bytes

 -2,147,483.648 to 2,147,483,647

 long

 8 bytes

  -9,223.372,036.854,775.808 to 9,223.372,036,854,775,808

 float

 4 bytes

 6 to 7 decimal digits

 double

 8 bytes

 15 decimal digits

 boolean

 1 byte

 true or false

 char

 2 bytes

 a single character or letter 



Non-primitive Data Types


Non-primitive data types don't store value but store a reference of the value. 

* reference type - Array, Variable, Class, Interface




Reference

Hackerrank (https://www.hackerrank.com/)

w3schools (www.w3schools.com)

'JAVA' 카테고리의 다른 글

instance in Java  (0) 2018.12.31
main method in Java  (0) 2018.12.31
Java loop example  (0) 2018.12.18
Scanner class in Java(User input)  (0) 2018.12.18
Displaying text in Java (println and printf)  (0) 2018.12.18