public class Test {
public static void main(String args[]) {
System.out.println(CoffeeSize.BIG == CoffeeSize.BIG);
}
}
enum CoffeeSize {
// 8, 10 & 16 are passed to the constructor
BIG(8), HUGE(10), OVERWHELMING(16);
CoffeeSize(int ounces) { // constructor
this.ounces = ounces;
System.out.println(ounces);
}
private int ounces; // an instance variable
public int getOunces() {
return ounces;
}
}
public static void main(String args[]) {
System.out.println(CoffeeSize.BIG == CoffeeSize.BIG);
}
}
enum CoffeeSize {
// 8, 10 & 16 are passed to the constructor
BIG(8), HUGE(10), OVERWHELMING(16);
CoffeeSize(int ounces) { // constructor
this.ounces = ounces;
System.out.println(ounces);
}
private int ounces; // an instance variable
public int getOunces() {
return ounces;
}
}
329

被折叠的 条评论
为什么被折叠?



