League of Legends

it/programming

[JAVA] 메소드 생성자 사용 League of Legends 상점구현

import java.util.Scanner; class champ { String code, name; int price; champ(String code, String name, int price) { this.code=code; this.name=name; this.price=price; } champ(String code, String name) { this.code=code; this.name=name; this.price=0; } void purchase() { if(this.price==0) System.out.println("이미 구입한 챔피언 입니다."); else { System.out.println(""); switch(this.code) { case "1": System.out.pr..

반응형
훈솔
'League of Legends' 태그의 글 목록