试题详情
单项选择题 public class Base {  public static final String FOO = “foo”;  public static void main(String[] args) {  Base b = new Base();  Sub s = new Sub();  System.out.print(Base.FOO);  System.out.print(Sub.FOO);  System.out.print(b.FOO);  System.out.print(s.FOO);  System.out.print(((Base)s).FOO);  } }  class Sub extends Base {public static final String FOO=bar;}  What is the result?() 

A、 foofoofoofoofoo

B、 foobarfoobarbar

C、 foobarfoofoofoo

D、 foobarfoobarfoo

E、 barbarbarbarbar

F、 foofoofoobarbar

G、 foofoofoobarfoo

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

热门试题