标题:头大了
取消只看楼主
神经塔
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:1986
专家分:4
注 册:2006-7-1
结帖率:0
 问题点数:0 回复次数:0 
头大了

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编辑过]

搜索更多相关主题的帖子: int public Drink static final 
2006-09-22 23:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-92271-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.061889 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved