일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- DB
- MIPS
- DS
- react
- computer
- while
- XML
- function
- MacOS
- Class
- github
- php
- Algorithm
- html
- architecture
- for
- CSS
- javascript
- DATAPATH
- Java
- python
- control
- web
- system
- instruction
- data structure
- mysql
- DoM
- Pipelining
- Linux
- Today
- Total
목록primitive (2)
YYYEJI
① Integer • . . . -2, -1, 0, 1, 2, . . . etc. • byte (1 bytes) • short (2 bytes) • int (4 bytes) • long (8 bytes) ② Floating point • 9.99, 3.15913494, -5.0 etc. • float (4 bytes) • double (8 bytes) ③ Character • 'Hello world' etc. • char (2 bytes) • Using single quotes • System.out.println('Hello World'); ④ Boolean • True (1 bit) • False (1 bit) ◡̈
자바는 변수를 사용하기 전에 타입 선언을 무조건 해줘야 됩니다. 타입을 선언하는 format은 아래와 같습니다. Type variable_name; int num; char result; double amout; String sentence; 자바에서 변수를 선언할 때 사용하는 TYPE은 두 종류가 있습니다. ① Primitive data type ② Class type Primitive type부터 알아봅시다. Primitive data type • 간단하게 말하면 심플합니다. • Data만 있고 method는 없습니다. • 첫 문자를 소문자로 시작합니다. int num; char result; double amout; Class type • 타입이 클래스입니다. (Class = Object) • Pr..