1. package foo; 2.  3. import java.util.Vector; 4.  5. protected class MyVector Vector { 6. init i = 1; 7. public MyVector() { 8. i = 2; 9. } 10. } 11.  12. public class MyNewVector extends MyVector { 13. public MyNewVector() { 14. i = 4; 15. } 16. public

题目

1. package foo; 2.  3. import java.util.Vector; 4.  5. protected class MyVector Vector { 6. init i = 1; 7. public MyVector() { 8. i = 2; 9. } 10. } 11.  12. public class MyNewVector extends MyVector { 13. public MyNewVector() { 14. i = 4; 15. } 16. public static void main(String args[]) { 17. MyVector v = new MyNewVector(); 18. } 19. } What is the result?()  

  • A、 Compilation succeeds.
  • B、 Compilation fails because of an error at line 5.
  • C、 Compilation fails because of an error at line 6.
  • D、 Compilation fails because of an error at line 14.
  • E、 Compilation fails because of an error at line 17.

相似考题
更多“1. package foo;̳”相关问题
  • 第1题:

    Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()

    • A、 pageContext.getAttribute(“foo”);
    • B、 getPageContext().getAttribute(“foo”);
    • C、 pageContext.getApplicationScope(“foo”);
    • D、 pageContext.getAttribute(“foo”,pageContext.APPLICATION_SCOPE).getAttribute(“foo”);
    • E、 getPageContext().getScope(pageContext.APPLICATION_SCOPE).getAttribute(“foo”);

    正确答案:D

  • 第2题:

    package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? () 

    • A、 An instance of the Inner class can be constructed with “new Outer.Inner ()”
    • B、 An instance of the inner class cannot be constructed outside of package foo.
    • C、 An instance of the inner class can only be constructed from within the outer class.
    • D、 From within the package bar, an instance of the inner class can be constructed with “new inner()”

    正确答案:A

  • 第3题:

    class Foo {  private int x;  publicFoo(intx) {this.x=x; }  public void setX( int x) { this.x = x; }  public int getX() { return x; }  }   public class Gamma {  static Foo fooBar( Foo foo) {  foo = new Foo( 100);  return foo;  }  public static void main( String[] args) {  Foo foo = new Foo( 300);  System.out.print( foo.getX() + “-“);  Foo fooFoo = fooBar( foo);  System.out.print( foo.getX() + “-“);  System.out.print( fooFoo.getX() + “-“);  foo = fooBar( fooFoo);  System.out.print( foo.getX() + “-“);  System.out.prmt( fooFoo.getX());  }  }  What is the output of this program?()

    • A、 300-100-100-100-100
    • B、 300-300-100-100-100
    • C、 300-300-300-100-100
    • D、 300-300-300-300-100

    正确答案:B

  • 第4题:

    foo对象有att属性,那么获取att属性的值,以下哪些做法是可以的?()

    • A、foo.att
    • B、foo(“att”)
    • C、foo[“att”]
    • D、foo{“att”}
    • E、foo[“a”+“t”+“t”]

    正确答案:A,C,E

  • 第5题:

    console.log(foo);varfoo="foo!";console.log(foo);执行上面代码,控制台会输出()。

    • A、undefined undefined
    • B、foo! undefined
    • C、undefined foo!
    • D、foo! fool!

    正确答案:C

  • 第6题:

    Given a correctly compiled class whose source code is:  package com.sun.sjcp;  public class Commander {  public static void main(String[] args) {  // more code here  }  }  Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the classpath contains “.“ (current directory). Which command line correctly runs Commander?() 

    • A、 java Commander
    • B、 java com. sim. sjcp.Commander
    • C、 java com/sun/sjcp/Commander
    • D、 java -cp com.sun.sjcp Commander
    • E、 java -cp com/sun/sjcp Commander

    正确答案:B

  • 第7题:

    Given: 1.<% int[] nums = {42,420,4200}; 2.request.setAttribute("foo", nums); %> 3.${5 + 3 lt 6} 4.${requestScope[’foo’][0] ne 10 div 0} 5. ${10 div 0} What is the result?()

    • A、True true
    • B、False true
    • C、False true 0
    • D、True true Infinity
    • E、False true Infinity

    正确答案:E

  • 第8题:

    单选题
    String foo = “blue”;    Booleanbar = new Boolean [1];    if (bar[0]) {    foo = “green”;    }   What is the result?()
    A

     Foo has the value of “”

    B

     Foo has the value of null.

    C

     Foo has the value of “blue”

    D

     Foo has the value of “green”

    E

     An exception is thrown.

    F

     The code will not compile.


    正确答案: E
    解析: 暂无解析

  • 第9题:

    多选题
    Which the three are valid declarations of a float?()
    A

    float foo = -1;

    B

    float foo = 1.0;

    C

    float foo = 42el:

    D

    float foo = 2.02f:

    E

    float foo = 3.03d:


    正确答案: D,C
    解析: 暂无解析

  • 第10题:

    单选题
    Given an EL function foo, in namespace func, that requires a long as a parameter and returns a Map, which two are valid invocations of function foo?()
    A

     ${func(1)}

    B

     ${foo:func(4)}

    C

     ${func:foo(2)}

    D

     ${foo(5):func}

    E

     ${func:foo(“easy”)}

    F

     ${func:foo(“3”).name}


    正确答案: A
    解析: 暂无解析

  • 第11题:

    多选题
    Which three are valid declarations of a float? ()
    A

    Float foo = -1;

    B

    Float foo = 1.0;

    C

    Float foo = 42e1;

    D

    Float foo = 2.02f;

    E

    Float foo = 3.03d;

    F

    Float foo = 0x0123;


    正确答案: F,A
    解析: 暂无解析

  • 第12题:

    多选题
    class One {   public One foo() { return this; }  }  class Two extends One {  public One foo() { return this; }  }  class Three extends Two {   // insert method here  }  Which two methods, inserted individually, correctly complete the Three class?()
    A

    public void foo() { }

    B

    public int foo() { return 3; }

    C

    public Two foo() { return this; }

    D

    public One foo() { return this; }

    E

    public Object foo() { return this; }


    正确答案: D,B
    解析: 暂无解析

  • 第13题:

    Which the three are valid declarations of a float?()

    • A、 float foo = -1;
    • B、 float foo = 1.0;
    • C、 float foo = 42el:
    • D、 float foo = 2.02f:
    • E、 float foo = 3.03d:

    正确答案:A,D,F

  • 第14题:

    Given an EL function foo, in namespace func, that requires a long as a parameter and returns a Map,which two are valid invocations of function foo?()

    • A、${func(1)}
    • B、${foo:func(4)}
    • C、${func:foo(2)}
    • D、${foo(5):func}
    • E、${func:foo("easy")}
    • F、${func:foo("3").name}

    正确答案:C,F

  • 第15题:

    Which three are valid declarations of a float? () 

    • A、 Float foo = -1;
    • B、 Float foo = 1.0;
    • C、 Float foo = 42e1;
    • D、 Float foo = 2.02f;
    • E、 Float foo = 3.03d;
    • F、 Float foo = 0x0123;

    正确答案:A,D,F

  • 第16题:

    下面选项中哪一个是和$("#foo")等价的写法()。

    • A、$(“foo#”)
    • B、$(“foo”)
    • C、$(“.foo”)
    • D、jquery(“#foo”)

    正确答案:D

  • 第17题:

    1. class SuperFoo {  2. SuperFoo doStuff(int x) {  3. return new SuperFoo(); 4. }  5. }  6.  7. class Foo extends SuperFoo {  8. //insert code here  9. }   下面哪三项分别插入到第8行,可以编译?()

    • A、int doStuff() { return 42; }
    • B、int doStuff(int x) { return 42; }
    • C、Foo doStuff(int x) { return new Foo(); }
    • D、SuperFoo doStuff(int x) { return new Foo(); }

    正确答案:A,C,D

  • 第18题:

    String foo = “blue”;    Booleanbar = new Boolean [1];    if (bar[0]) {    foo = “green”;    }   What is the result?()  

    • A、 Foo has the value of “”
    • B、 Foo has the value of null.
    • C、 Foo has the value of “blue”
    • D、 Foo has the value of “green”
    • E、 An exception is thrown.
    • F、 The code will not compile.

    正确答案:F

  • 第19题:

    多选题
    1. class SuperFoo {  2. SuperFoo doStuff(int x) {  3. return new SuperFoo(); 4. }  5. }  6.  7. class Foo extends SuperFoo {  8. //insert code here  9. }   下面哪三项分别插入到第8行,可以编译?()
    A

    int doStuff() { return 42; }

    B

    int doStuff(int x) { return 42; }

    C

    Foo doStuff(int x) { return new Foo(); }

    D

    SuperFoo doStuff(int x) { return new Foo(); }


    正确答案: D,C
    解析: 暂无解析

  • 第20题:

    单选题
    package com.sun.sjcp; public class Commander{ public static void main(String[]args){ //more code here } } Assume that the class fileis located in /foo/com/sun/sjcp/,the current directory is/foo/,and that the classpath contains“.“(current directory). Which command line correctly runs Commander?()
    A

    java Commander

    B

    java com.sim.sjcp.Commander

    C

    java com/sun/sjcp/Commander

    D

    java-cpcom.sun.sjcp Commander

    E

    java-cpcom/sun/sjcp Commander


    正确答案: C
    解析: 暂无解析

  • 第21题:

    单选题
    package foo; public class Outer (  public static class Inner (  )  )   Which statement is true? ()
    A

     An instance of the Inner class can be constructed with “new Outer.Inner ()”

    B

     An instance of the inner class cannot be constructed outside of package foo.

    C

     An instance of the inner class can only be constructed from within the outer class.

    D

     From within the package bar, an instance of the inner class can be constructed with “new inner()”


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    package foo;  public class Outer {  public static class Inner {  }  }   Which statement is true?()
    A

     Compilation fails.

    B

     An instance of the Inner class can be constructed with “new Outer.Inner()”.

    C

     An instance of the Inner class cannot be constructed outside of package foo.

    D

     An instance of the Inner class can be constructed only from within the Outer class.

    E

     From within the package foo, and instance of the Inner class can be constructed with “new Inner()”.


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    Given a correctly compiled class whose source code is:  package com.sun.sjcp;  public class Commander {  public static void main(String[] args) {  // more code here  }  }  Assume that the class file is located in /foo/com/sun/sjcp/, the current directory is /foo/, and that the classpath contains “.“ (current directory). Which command line correctly runs Commander?()
    A

     java Commander

    B

     java com. sim. sjcp.Commander

    C

     java com/sun/sjcp/Commander

    D

     java -cp com.sun.sjcp Commander

    E

     java -cp com/sun/sjcp Commander


    正确答案: C
    解析: 暂无解析

  • 第24题:

    单选题
    下面选项中哪一个是和$("#foo")等价的写法()。
    A

    $(“foo#”)

    B

    $(“foo”)

    C

    $(“.foo”)

    D

    jquery(“#foo”)


    正确答案: D
    解析: 暂无解析