Records rather than Memories

[java] 변수 (Variable) 본문

Software/JAVA

[java] 변수 (Variable)

Downer 2019. 9. 29. 20:06

변수의 선언과 할당

 

int a;  // 변수 선언

- int : data type

- a : name of variable(변수의 이름)

 

* int는 정수를 담겠다고 지정한 것

 

a=1;

System.out.println(a+1); //2

 

a=2;

System.out.println(a+1); //3

 

a에 담겨진 값을 이용해 출력이 된다.

'Software > JAVA' 카테고리의 다른 글

[java] 정수와 실수  (0) 2019.10.01
Eclipse의 기능  (0) 2019.09.30
JAVA의 실행  (0) 2019.09.29
[java] Data type 자료형  (0) 2019.09.28
JAVA의 구성  (0) 2019.09.27
Comments