일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- 자바스크립트
- mongo
- 기록
- 생각정리
- WIL
- javascript
- 생각로그
- mongoose
- next.js
- react
- 주간회고
- js
- 리눅스
- 코테
- MongoDB
- Git
- nest.js
- 네트워크
- 피드백
- 회고
- Grafana
- typescript
- Java
- 생각일기
- 알고리즘
- mysql
- array
- CS
- 트러블슈팅
- til
- Today
- Total
코딩일상
[JAVA] 입력과 출력 (직장인의 생활코딩 공부일상) 본문
INPUT값이 있으면 프로그램을 통해서 OUTPUT이 나오게 된다
이러한 과정을 어떻게 하면 좀더 유저들이 편하게 하며 실수와
오류가 없을지 알아보았다.
이 수업을 들으면서 다시한번 검색과 서칭 능력의 중요성을 깨달았으며
데이터의 타입과 입력과 아웃푹의 과정이 되는
코드구조를 잘 짜는것이 중요하다는것을 한번더
느꼈다
구글검색 방식
텍스트 입력 박스를 만들기위해
JAVA POPUP input text
string을 double로 변경하기 위해
java string to double
코딩내용
import javax.swing.JOptionPane;
import org.opentutorials.iot.DimmingLights;
import org.opentutorials.iot.Elevator;
import org.opentutorials.iot.Lighting;
import org.opentutorials.iot.Security;
public class OkJavaGoInHomeInput {
public static void main(String[] args) {
String id = JOptionPane.showInputDialog("Enter a ID");
String bright = JOptionPane.showInputDialog("Enter a Bright");
// 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();
DimmingLights moodLamp = new DimmingLights(id+"moodLamp");
moodLamp.setBright( Double.parseDouble(bright));
moodLamp.on();
}
}
'개발 공부 > JAVA' 카테고리의 다른 글
[JAVA]라이브러리?? 내가 볼 땐 제일 중요한개념(직장인의 생활코딩 공부 후기) (0) | 2022.04.17 |
---|---|
[JAVA] 입력(argument)와 매개변수(parameter)의 관계(직장인의 새활코딩 공부기록) (0) | 2022.04.17 |
[JAVA] casting?? 음 그냥 일단 이런게 있구나(직장인 생활코딩 공부 기록) (0) | 2022.04.13 |
[JAVA] 변수의 유용함 + 왜 해야 하는가?? (0) | 2022.04.13 |
[JAVA] 변수의 정의 (직장인의 생활코딩 기록) (1) | 2022.04.13 |