publicclassBall{publicenumColor{RED,GREEN,BLUE};publicvoidfoo(){//insertcodehere{System.out.println(c);}}}Whichcodeinsertedatline14causesthefoomethodtoprintRED,GREEN,andBLUE?()A.for(Colorc:Color.values())B.for(Colorc=RED;c<=BLUE;c++)C.for(Colorc;c.hasNext

题目
publicclassBall{publicenumColor{RED,GREEN,BLUE};publicvoidfoo(){//insertcodehere{System.out.println(c);}}}Whichcodeinsertedatline14causesthefoomethodtoprintRED,GREEN,andBLUE?()

A.for(Colorc:Color.values())

B.for(Colorc=RED;c<=BLUE;c++)

C.for(Colorc;c.hasNext();c.next())

D.for(Colorc=Color[0];c<=Color[2];c++)

E.for(Colorc=Color.RED;c<=Color.BLUE;c++)


相似考题
更多“publicclassBall{publicenumColor{RED,GREEN,BLUE};publicvoidfoo(){//insertcodehere{System.out.println(c);}}}Whichcodeinsertedatline14causesthefoomethodtoprintRED,GREEN,andBLUE?() ”相关问题
  • 第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