자바 개발 환경 구축
JRE = JVM + 표준 클래스 라이브러리
JDK = JRE + 개발도구
변수
하나의 값을 저장할 수 있는 메모리 공간
변수의 선언 : ex) int, double, String, char, boolean etc
int value; // 변수 value 선언
Int result = value + 100; // value + 100의 값을 선언된 result에 저장
boolean 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | package ch3; public class DenyExample { public static void main(String[] args) { boolean run = true; System.out.println(run); // true run = !run; System.out.println(run); // false run = !run; System.out.println(run); // true } } | cs |
String 예제
1 2 3 4 5 6 7 8 9 10 11 12 | package ch3; public class StringExample { public static void main(String[] args) { String str1 = "호랑이"; String str2 = "6.0"; String str3 = str1 + str2; System.out.println(str3); } } | cs |
'문돌이의 IT > 자바(Java)' 카테고리의 다른 글
자바(Java) 삼항연산자 (0) | 2017.01.04 |
---|---|
자바(java) 비교연산자와 논리연산자 (0) | 2017.01.03 |
자바(Java)프로그래밍이란? (0) | 2017.01.02 |
자바(Java) DriverManager 사용하기 (0) | 2016.04.29 |
자바(Java) 구구단 소스코드 (0) | 2016.04.10 |