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?()
第1题:
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
第2题:
Assume a tag handler extends TagSupport. Which is used within the tag handler to get an attribute “foo” that is in the application scope?()
第3题:
A、foo.att
B、foo[“att“]
C、foo{“att“}
D、foo[“a“+“t“+“t“]
第4题:
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?()
第5题:
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true? ()
第6题:
package foo; public class Outer { public static class Inner { } } Which statement is true?()
第7题:
Which the three are valid declarations of a float?()
第8题:
A.Truetrue
B.Falsetrue
C.Falsetrue0
D.TruetrueInfinity
E.FalsetrueInfinity
第9题:
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?()
第10题:
Which three are valid declarations of a float? ()