Hi,
i come across this question:
given:
package sun.scjp;
public enum Color { RED, GREEN, BLUE}
package sun.beta;
//insert code here
public class Beta{
Color g= GREEN;
public static void main(String [] args){
System.out.println(GREEN);}
}
}
The class Beta and the enum Color are in different packages.
Which two code fragments, inserted individually at line 2 of the Beta declaration,
will allow this code to compile? (choose 2)
a. import sun.scjp.Color.*;
b. import static sun.scjp.Color.*;
c. import sun.scjp.Color; import static sun.scjp.Color.*;
d. import sun.scjp.*; import static sun.scjp.Color.*;
e. import sun.scjp.Color; import static sun.scjp.Color.GREEN;
My answer is C and D, while the correct answer is C and E.
How? D and E looks the same.. Can anyone give me a clear explanation about this?
appreciate your help