본문 바로가기
  • Build Up Routine
Basic/생활코딩 Java1

생활코딩 JAVA1 수업노트 리뷰#5 _ 변수와 프로그래밍

by 까느.dev 2022. 3. 6.

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

 

프로그래밍이란? - 생활코딩

강의소개 시간의 순서에 따라서 일어나야 하는 일을 컴퓨터에게 알려주는 일이 프로그래밍입니다. 프로그래밍을 통해서 만든 결과물이 프로그램입니다. 이 수업에서는 프로그래밍의 의미를 파

opentutorials.org

 

 

댓글