public class home9 {
public static void main(String[] args) {
cute c = new cute();
c.print("kor");
}
}
enum country{
KOR("한국", "불고기");
public String getCountryname() {
return countryname;
}
public void setCountryname(String countryname) {
this.countryname = countryname;
}
public String getCountryfood() {
return countryfood;
}
public void setCountryfood(String countryfood) {
this.countryfood = countryfood;
}
String countryname;
String countryfood;
country(String countryname, String countryfood){
this.countryfood = countryfood;
this.countryname = countryname;
}
}
class cute{
public void print(String ccountry){
country c = country.valueOf(ccountry.toUpperCase());
System.out.println(c.getCountryname() + "의 대표음식은 " + c.getCountryfood());
}
}
댓글 영역