Declarations and Access Control Logic
© examsiri.com
Question : 23 of 29
Marks:
+1,
-0
Given:
The class Beta and the enum Color are in different packages.Which two code fragments, inserted individually at line 2 of the Betadeclaration, will allow this code to compile?
1. package sun.scjp;
2. public enum Color { RED, GREEN, BLUE }
1. package sun.beta;
2. /*insert code here*/
3. public class Beta {
4.   Color g = GREEN;
5.   public static void main( String[] argv)
6.   { System.out.println( GREEN); }
7. }The class Beta and the enum Color are in different packages.Which two code fragments, inserted individually at line 2 of the Betadeclaration, will allow this code to compile?
Go to Question: