[프로그래밍언어][Java(자바)] 자료형, 변수형, 데이터 타입 - 종류, 크기, 범위

728x90

 

https://www.javatpoint.com/java-data-types

http://tcpschool.com/java/java_datatype_basic

 

<  Data Type  >

 

  • Primitive
    • Boolean
      • boolean
    • Numeric
      • Character
        • char
      • Integral
        • Integer
          • byte
          • short
          • int
          • long
        • Floating-point
          • float
          • double
  • Non-Primitive
    • Classes
    • Interfaces
    • Arrays
    • etc.

 

Data Type Default size Data Range Default Value
boolean 1 bit true 또는 false false
char 2 byte 0 ~ 2^16 '\u0000'
byte 1 byte -2^7 ~ (2^7 - 1)
-128 ~ 127
0
short 2 byte -2^15 ~ (2^15 - 1)
-32,768 ~ 32,767
0
int 4 byte -2^31 ~ (2^31 - 1)
-2,147,483,648 ~ 2,147,483,647
0
long 8 byte -2^63 ~ (2^63 - 1)
-9,223,372,036,854,775,808 ~
9,223,372,036,854,775,807
0L
float 4 byte (3.4 X 10^(-38)) ~ (3.4 X 10^38) 0.0f
double 8 byte (1.7 X 10^(-308)) ~ (1.7 X 10^308) 0.0d

 

 

반응형