package zuoye;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author lss
* @version 1.0
*/
abstract class Drink{
Drink() {
}
abstract void taste();
public static final int Coffee = 1;
public static final int Beer = 2;
public static final int Milk = 3;
public static Drink getDrink(int driinkType) {
switch (driinkType) {
case 1:
System.out.println("咖啡:");
case 2:
System.out.println("啤酒:");
case 3:
System.out.println("牛奶:");
}
}
class Coffee extends Drink {
Coffee() {
}
void taste() {
System.out.println("苦味");
}
}
class Beer extends Drink {
Beer() {
}
void taste() {
System.out.println("辛辣");
}
}
class Milk extends Drink {
Milk() {
}
void taste() {
System.out.println("甜味");
}
}
public class Test {
public Test() {
}
public static void main(String[] args) {
try {
Drink.getDrink(Integer.parseInt(args[0]));
} catch (Exception e) {
System.out.println(e.toString());
}
}
}
}
问什么有错????快来救我啊~
[此贴子已经被作者于2006-9-22 23:19:52编辑过]