单项选择题


What is the result?()

A. The code compiles and “s=” is printed.
B. The code compiles and “s=” + s);
C. The code does not compile because Strings is not initialized.
D. The code does not compile because Strings cannot be referneed.
E. The code comiles, but a NullPointer Exception is thrown when toString is called.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题Which the two are reserved words in Java?()

A. run
B. import
C. default
D. implement

2.单项选择题

What is the result?()

A. foo has the value of “”
B. foo hast he falue 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.

4.单项选择题


What is the result?()

A. The program runs and prints nothing.
B. The program runs and prints “Equal”.
C. An error at line 5 cause compilation to fail.
D. The program runs but aborts with an exception.

5.单项选择题


What is the result?()

A. The program runs and prints “0”
B. The program runs and prints “1”
C. The program runs but aborts with an exception.
D. An error “possible undefined variable” at line 4 causes compilation to fail.
E. An error “possible undefined variable” at line 9 cause compilation to fail.

6.单项选择题


What is the result()?  

A. 2
B. 4
C. 8
D. 16
E. The code will not compile.

7.多项选择题Which the two demonstrate an “is a” relationship?()

A. public interface Person {}  Public class Employee extends Person {}
B. public interface Shape {}  public interface Rectangle extends Shape {}
C. public interface Color {}  public class Shape { private Color color; }
D. public class Species {}  public class Animal { private Species species; }
E. interface Component {} Class Container implements Component {private Component [] children;

8.多项选择题


Which two overload the setVar method()

A.A
B.B
C.C
D.D
E.E

9.单项选择题Which thefollowingstatements about static inner classes is true?()

A. An anonymous class can be declared as static.
B. A static inner class cannot be a static member of the outer class.
C. A static inner class does not require an instance of the enclosing class.
D. Instance member of a static inner class can be referenced using the class name of the staticinner class.

10.多项选择题Which the following two statements are true?()

A. An inner class may be declared as static.
B. An anonymous inner class can be declared as public.
C. An anonymous inner class can be declared as private.
D. An anonymous inner class can extend an abstract class.
E. An anonymous inner class can be declared as protected.

最新试题

Which three can be placed at line 23 to retrieve an existing HttpSession object?()

题型:多项选择题

Which the two are characteristics of the Service Locator pattern?()

题型:多项选择题

Which two classes or interfaces provide a getSession method?()

题型:多项选择题

When using Form Based Authentication, which pair of fields must be used in the login form?()  

题型:单项选择题

Within the web application deployment descriptor, which defines a valid JNDI environment entry()

题型:单项选择题

Given that session is a valid HttpSession object:  Int max = session.getAttribute(“MyReallyLongName”);  Which is true?()  

题型:单项选择题

Which the two are valid and equivalent?()

题型:多项选择题

Which the three are true about servlet filters?()

题型:多项选择题

Which two authentication mechanisms provide weaker protection than other mechanisms?()

题型:多项选择题

A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. This attribute holds an instance of the com.Company.  Product class with a name property of “The Matrix” and price property of 39.95. Given the JSP page code snippet:What is the response output of this JSP page code snippet? ()

题型:单项选择题