본문 바로가기

Programming/자바

생활코딩 자바 리뉴얼 8. 프로그래밍

https://www.youtube.com/watch?v=ejPBOti5omY&list=PLuHgQVnccGMAIluRRVsC1e79ri-dwnBmR&index=23 

 

IOT 프로그래밍

.xxx() => 메소드

 

import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Security;
import org.opentutorials.iot.Lighting;

public class okJavagoinhome {

public static void main(String[] args) {

String id = "Java APT 111";

//Elevator call
Elevator myelevator = new Elevator (id);
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();

}
}