Hello Dudes,
In K&B book page no 281, i am not understand following program and i'm not able to compile the program. I'm using
java 7 to compile this program.
public class Bridge{
public enum Suits{
CLUBS(20), DIAMONDS(20),HEARTS(30),SPADES(30),NOTRUMP(40){
public int getValue(int bid){
return ((bid-1)*30)+40;
}
};
Suits(int points){
this.points = points;
}
private int points;
public int getVaue(int bid){
return points*bid;
}
}
public static void main(
String[] args){
System.out.println(Suits.NOTRUMP.getBidValue(3));
System.out.println(Suits.SPADES+" "+Suits.SPADES.points);
System.out.println(Suits.values());
}
}
A. The output could contain 30
B. The output could contain @bf73fa
C. The output could contain DIAMONDS
D. Compilation fails due to an error on line 6
E. Compilation fails due to an error on line 7
F. Compilation fails due to an error on line 8
G. Compilation fails due to an error on line 9
H. Compilation fails due to an error within lines 12 to 14