1. 변수는 어떤 타입의 데이터를 담을 수 있는지 명확하게 표현을 해주어야한다.
2. 변수를 이용해 모든 데이터의 값을 한번에 정의하고 수정이 가능 할 수 있다.
public class Variable {
public static void main(String[] args) {
int a = 1; // Number -> integer(정수) -2,-1,0,1,2...
System.out.println(a);
double b = 1.1; // real number(실수) .... -2,0,-1,0.3,5.3 ...
System.out.println(b);
String C = "Hwllo world";
System.out.println(C);
// 변수가 어떤 타입의 데이터를 담을 수 있는지 명확하게 표현을 해주어야 한다.
}
}
1. 프로그래밍을하는 이유는 자동화를 해서 불필요한 인력을 줄이고 시간을 효율적으로 쓰는것. 사람일 할 일을 컴퓨터나 기계를 활용하여 많은 효율을 만들어내는 작업을 말한다.
2. 구성된 코드소스(?)를 불러내어 활용할 수 있다. (아마도 실무에서는 가장 많이 활용하지않을까?)
import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Lighting;
import org.opentutorials.iot.Security;
public class OkJavaGoinHome {
public static void main(String[] args) {
String id = "JAVA APT 507";
// Elevator call
Elevator myElevator = new Elevator(id);
// myElevator = 변수, Elevator = 데이터 타입 -> Elevator타입에는 myElevator변수만 올 수 있다는 뜼?
myElevator.callForUp(1);
// Security off
Security mySecurity = new Security(id);
mySecurity.off();
// Light on
Lighting hallLamp = new Lighting(id+" / Hall Lamp");
hallLamp.on();
Lighting floorLamp = new Lighting(id+" / floor Lamp");
floorLamp.on();
}
}
https://opentutorials.org/course/3930/26661
'Basic > 생활코딩 Java1' 카테고리의 다른 글
생활코딩 JAVA1 수업노트 리뷰#6 _ 입력과 출력 (0) | 2022.03.09 |
---|---|
생활코딩 JAVA1 수업노트 리뷰#5.1 _ 디버거 (0) | 2022.03.08 |
생활코딩 JAVA1 수업노트 리뷰#4 _ Java 숫자와 문자. (0) | 2022.03.05 |
생활코딩 JAVA1 수업노트 리뷰#3 _ Java 데이터와 연산 (0) | 2022.03.04 |
생활코딩 JAVA1 수업노트 리뷰#3 _ Java 기술의 응용 (0) | 2022.03.03 |
댓글