JAVA/생활코딩 JAVA 입문 수업
JAVA1 - 9.3. IOT 프로그램 만들기
kms152000
2023. 3. 14. 16:10
Programming 프로젝트에 OkJavaGoInHome 클래스 생성할 때 package란에 자동으로 위치 지정돼 있으면 빈칸으로 만듭니다.
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.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+" / floorLamp");
floorLamp.on();
}
}