설계
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FcavFf2%2FbtrNo7Q3pSA%2FvismlawYeeyQ15hccTLFV0%2Fimg.png)
[08] 프로그램 설계 방법론(제어 구조_조건-선택)
주제 : 제어 구조(Control Structure) 기술한 순서대로 진행 메서드 호출 선택 구조 : If와 else문을 사용하여 작성하는 문법 import javax.swing.JOptionPane; public class Conditional { public static void main(String[] args) { String input = JOptionPane.showInputDialog("나이를 알려주세요"); int age = Integer.parseInt(input); if(age
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FdGvxKf%2FbtrMOawdtXE%2FBHsZqQNokIOI3UQeF497RK%2Fimg.png)
[07] 프로그램 설계 방법론
주제 : 생성 메서드와 필드 변수 변수의 유효범위는 다음 코드를 통해 알 수 있다. import java.awt.Graphics; public class Scope { private double d = 3.14; public Scope() { System.out.println(s); System.out.println(d); int d = 2; System.out.println(d); System.out.println(s); } private String s = "X" + d; public void printComponent(Graphics g) { System.out.println(d + " " + s); } public static void main(String[] args) { new Scope();..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FXKtvF%2FbtrMMk5Fwqf%2FU3q3QiZKEuvbhzaQJubst1%2Fimg.png)
[06] 프로그램 설계 방법론(생성자와 필드 변수)
주제 : 생성 메서드와 필드 변수 생성 메서드(constructor method) : 객체가 태어나면서 저절로 한번 실행하는 메서드를 뜻한다. 생성 메서드를 만들 때는 클래스 이름과 동일하게 만든다. public class ClassName { public ClassName( par_1, …, par_n) { // 몸체 코드 블록 } } 실습 : 아날로그 시계를 만들어보자 import javax.swing.*; public class ClockWriter extends JPanel{ public ClockWriter() { JFrame frame = new JFrame(); frame.setTitle("Clock"); frame.setSize(300, 400); frame.setVisible(true);..