Contents
- 1. 2004/금
- 2. 기
- 3. : Programming
- 4. Code Review - 각 ?
- 5.
- 6. Structured Programming 개
- 7. HIPO
- 8. Paper Programming : HIPO 그기
- 9. HIPO 그 근거 구
- 10.
- 11. OOP 개
- 12. : CRC Card
- 13. OOP Demo 1 : Message ~ (Python)
- 14. OOP Demo 2 : Message ~ (Java & Eclipse)
- 15.
- 16. 간
- 17.
- 18. interface 개
- 19. 구 : 객 & 기
- 20. &
- 21.
- 22. 기
1.1.1. ¶
거 PT? PT 군.
개
--NeoCoin
개
군. C기 , C++(), Smalltalk(vm) . Early History 고 군. (SeeAlso Java Early history
개 Java 구 Servlet-JSP 기 고, 2001 기 'JavaTM 2 Playtform 1.3,' J2SE 꾸. 1.4 1 고, 1.5 8 . Java major upgrade 경
Java 개 Java 구 Servlet-JSP 기 고, 2001 기 'JavaTM 2 Playtform 1.3,' J2SE 꾸. 1.4 1 고, 1.5 8 . Java major upgrade 경
--NeoCoin
1.1.2.4. 간 그 ¶
- 그(FirstJava.java)
~cpp public class FirstJava { public static void main(String argv[]) { System.out.println("Hello world!"); } }
1.1.3. 기 ¶
~cpp
import javax.swing.*;
public class FirstJava extends JFrame{
public FirstJava()
{
}
public static void main(String args[]) {
FirstJava helloWorld = new FirstJava();
helloWorld.setBounds(100,100,800,600);
helloWorld.show();
}
}
~cpp
package WindowFrame;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import javax.swing.JFrame;
public class WindowFrame {
static BufferedReader breader;
public WindowFrame(String title, int width, int height) {
JFrame f = new JFrame(title);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setSize(width, height);
f.show();
}
public static int inputInt() throws IOException {
breader
= new BufferedReader(new InputStreamReader(System.in));
return Integer.parseInt(breader.readLine());
}
public static String inputString() throws IOException {
return breader.readLine();
}
public static void main(String[] args) {
breader = new BufferedReader(new InputStreamReader(System.in));
try {
System.out.print(" : ");
String title = inputString();
System.out.print(" : ");
int w = inputInt();
System.out.print(" : ");
int h = inputInt();
new WindowFrame(title, w, h);
} catch(IOException ex) {
ex.printStackTrace();
}
}
}

1.1.4. 그그기 ¶
- java.awt.Graphics
- public void paint(Graphics g)
-> 그 .
- g.drawString(String string, int s, int y)
-> int 그 ' x', ' y'
- g.drawLine(int startX, int startY, int endX, int endY)
-> int ' x', ' y', ' x', ' y'
- g.drawOval(int x, int y, int weight, int height)
-> int 그 ' x', ' y', ' ', ' '
- g.fillOval(int x, int y, int weight, int height)
-> int 그 ' x', ' y', ' ', ' '
~cpp
import java.awt.Graphics;
import javax.swing.*;
public class FirstJava extends JFrame{
public FirstJava()
{
}
public static void main(String args[]) {
FirstJava helloWorld = new FirstJava();
helloWorld.setBounds(100,100,800,600);
helloWorld.show();
}
public void paint(Graphics g)
{
g.drawLine(100,100,300,300);
g.drawOval(200,200,400,400);
g.fillOval(500,500,100,100);
}
}
1.1.5. ¶
- addMouseListener .
- mouseClicked -> 경
~cpp import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.*; public class FirstJava extends JFrame{ public FirstJava() { addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { int x = e.getX(); int y = e.getY(); System.out.println("x : " + x); System.out.println("y : " + y); } }); } public static void main(String args[]) { FirstJava helloWorld = new FirstJava(); helloWorld.setBounds(100,100,800,600); helloWorld.show(); } }
1.1.6.1. 경 paint ¶
- repaint()
~cpp
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.*;
public class FirstJava extends JFrame{
public FirstJava()
{
addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
int x = e.getX();
int y = e.getY();
repaint();
}
});
}
public static void main(String args[]) {
FirstJava helloWorld = new FirstJava();
helloWorld.setBounds(100,100,800,600);
helloWorld.show();
}
public void paint(Graphics g)
{
System.out.print("Click!! ");
}
}
3. : Programming ¶
~cpp 6 0 0 222244451 999 Output 1 1 1 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 2 0 0 0 0 1 0 0 0 0 0 0 0 0 5 0 0 22224444346 999 Output 2 1 1 1 1 1 0 0 0 2 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 3 0 0 44220064 999 Output 1 1 1 1 1 1 1 1 1
13. OOP Demo 1 : Message ~ (Python) ¶
고, 간 c:\python23\python.exe .
~cpp
from StarCraft import StarCraft
sc = StarCraft ()
dir(sc)
gateway = sc.createGateway ()
dir(gateway)
z1 = gateway.createZealot ()
dir(z1)
z1.move (160,160)
d1 = gateway.createDragoon ()
dir(d1)
d1.move (180,180)
z1.printHp()
z1.getPosition()
d1.printHp()
d1.getPosition()
z1.setAttackTarget(d1)
z1.printAttackTarget()
z1.getAttackTarget().printHp()
z1.getAttackTarget().getPosition()
z1.attack()
d1.printHp()















