packagesun.scjp;publicenumColor{RED,GREEN,BLUE}packagesun.beta;//insertcodeherepublicclassBeta{Colorg=GREEN;publicstaticvoidmain(String[]argv){System.out.println(GREEN);}}TheclassBetaandtheenumColorareindifferentpackages.Whichtwocodefragments,insertedindi

题目

packagesun.scjp;publicenumColor{RED,GREEN,BLUE}packagesun.beta;//insertcodeherepublicclassBeta{Colorg=GREEN;publicstaticvoidmain(String[]argv){System.out.println(GREEN);}}TheclassBetaandtheenumColorareindifferentpackages.Whichtwocodefragments,insertedindividuallyatline2oftheBetadeclaration,willallowthiscodetocompile?()

A.importsun.scjp.Color.*;

B.importstaticsun.scjp.Color.*;

C.importsun.scjp.Color;importstaticsun.scjp.Color.*;

D.importsun.scjp.*;importstaticsun.scjp.Color.*;

E.importsun.scjp.Color;importstaticsun.scjp.Color.GREEN;


相似考题
参考答案和解析
参考答案:C, E
更多“packagesun.scjp;publicenumColor{RED,GREEN,BLUE}packagesun.beta;//insertcodeherepublicclass ”相关问题
  • 第1题:

    1、如下选项,哪个不是定义类型名tcolor________。

    A.enum tcolor{red, green, blue};

    B.typedef enum color{red,green,blue} tcolor;

    C.enum color {red,green,blue}; typedef enum color tcolor;

    D.typedef enum {red,green,blue} tcolor;


    enum tcolor{red, green, blue};

  • 第2题:

    如下选项,哪个不是定义类型名tcolor________。

    A.enum tcolor{red, green, blue};

    B.typedef enum color{red,green,blue} tcolor;

    C.enum color {red,green,blue}; typedef enum color tcolor;

    D.typedef enum {red,green,blue} tcolor;


    错误

  • 第3题:

    8、定义一个颜色的枚举类型Color,下面正确的是()。

    A.public enum Color {red, green, yellow, blue}

    B.public enum Color {1:red, 2:green, 3:yellow, 4:blue}

    C.public enum Color {1:red; 2:green; 3:yellow; 4:blue}

    D.public enum Color {Stringred, String green, String yellow, String blue}


    101

  • 第4题:

    定义一个颜色的枚举类型Color,下面正确的是()。

    A.public enum Color {red, green, yellow, blue}

    B.public enum Color {1:red, 2:green, 3:yellow, 4:blue}

    C.public enum Color {1:red; 2:green; 3:yellow; 4:blue}

    D.public enum Color {Stringred, String green, String yellow, String blue}


    public enumColor{red,green,yellow,blue;}

  • 第5题:

    在Android中颜色值的排列顺序是

    A.Red-Green-Blue-Alpha

    B.Alpha-Red-Blue-Green

    C.Alpha-Red-Green-Blue

    D.Blue-Green-Red-Alpha


    #f00;#6f00;#0000ff;#6600ff00