-
Notifications
You must be signed in to change notification settings - Fork 0
/
SlideStatements.java
70 lines (56 loc) · 1.53 KB
/
SlideStatements.java
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package move;
/**
* Slide Statements
*
* 문장 슬라이드 하기
*/
public class SlideStatements {
static class Old {
public Order createOrder() {
int orderNo = 10;
String orderName = "주문";
int deliveryNo = 30;
int price = 3000;
int fee = (int) (price * 0.97);
int time = 300;
Order order = new Order(orderNo, orderName, price);
Delivery delivery = new Delivery(deliveryNo, orderNo, fee, time);
return order;
}
}
static class New {
public Order createOrder() {
int orderNo = 10;
String orderName = "주문";
int price = 3000;
Order order = new Order(orderNo, orderName, price);
int deliveryNo = 30;
int fee = (int) (price * 0.97);
int time = 300;
Delivery delivery = new Delivery(deliveryNo, order.no, fee, time);
return order;
}
}
static class Order {
int no;
String name;
int price;
public Order(int no, String name, int price) {
this.no = no;
this.name = name;
this.price = price;
}
}
static class Delivery {
int no;
int orderNo;
int fee;
int time;
public Delivery(int no, int orderNo, int fee, int time) {
this.no = no;
this.orderNo = orderNo;
this.fee = fee;
this.time = time;
}
}
}