일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- C++
- bool
- codecademy
- python
- 코딩도장
- for
- Bull
- 파이선
- Euler
- std
- Polymorphism
- CSS
- Java
- html
- cow
- Project
- cout
- unreal engine4
- 연결리스트
- Notting hill
- if
- html5
- endl
- dictation
- 알고리즘
- 파이썬
- Unreal
- font weight
- 영알남
- UE4
- Today
- Total
목록Polymorphism (3)
package javafuture; import javafx.scene.Parent; import java.util.*; public class Example { public static void main(String[] args) { Buyer b = new Buyer(); TV tv=new TV(); Computer com=new Computer(); Audio audio =new Audio(); b.buy(tv); b.buy(com); b.buy(audio); System.out.println(b.bonusPoint); System.out.println(b.money); b.summary(); System.out.println(); b.refund(com); b.summary(); } } class..
package javafuture; import javafx.scene.Parent; public class Example { public static void main(String[] args) { Buyer b = new Buyer(); b.buy(new TV()); b.buy(new Computer()); b.buy(new Audio()); System.out.println(b.bonusPoint); System.out.println(b.money); b.summary(); } } class Product { int price; int bonusPoint; Product(int price) { this.price = price; bonusPoint = (int) (price / 10); } Prod..
package javafuture; import javafx.scene.Parent; public class Example { public static void main(String[] args) { Buyer b=new Buyer(); b.buy(new Tv()); b.buy(new Computer()); System.out.println(b.money); System.out.println(b.bonusPoint); } } class Product{ int price; // product's price int bonusPoint; // membership point when you buy something Product(int price){ this.price=price; this.bonusPoint=..