试题详情
单项选择题 public class Ball {  public enum Color { RED, GREEN, BLUE };  public void foo() {  // insert code here  { System.out.println(c); }  }  }  Which code inserted at line 14 causes the foo method to print RED, GREEN, and BLUE?() 

A、 for( Color c : Color.values())

B、 for( Color c = RED; c <= BLUE; c++)

C、 for( Color c; c.hasNext() ; c.next())

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

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

  • A
  • 关注下方微信公众号,在线模考后查看

热门试题