单项选择题


What is the result()?

A. The program runs and prints “ I = 1 , j = 0”
B. The program runs and prints “ I = 1 , j = 4”
C. The program runs and prints “ I = 3 , j = 4”
D. The program runs and prints “ I = 3 , j = 0”
E. An error at line 4 cause compilation to fail.
F. An error at line 7 cause compilation to fail.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题


What is the result?()

A. An exception is thrown.
B. The code does not compile.
C. “Hello worlds.” Is printed to the terminal.
D. The program exits without printing anything.

2.单项选择题Which will declare the method that forces a subclass to implement it?()

A. public double methoda ():
B. static void methoda(double d1) {}
C. public native double methoda ():
D. abstract public foid methoda ():
E. protected void methoda (double d1) {}

3.单项选择题


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.

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

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

5.单项选择题

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.

7.单项选择题


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.

8.单项选择题


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.

9.单项选择题


What is the result()?  

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

10.多项选择题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;

最新试题

What else must the developer do to ensure that the intended security goal is achieved()?  

题型:单项选择题

Given the HttpServlet code:  getServletContext().setAttribute(“foo”, “value”);What is the result?()

题型:单项选择题

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

题型:单项选择题

Which code snippet, inserted at line 8, causes the value Company to be output?()

题型:单项选择题

The tag handler for n:recurse extends SimpleTagSupport.Assuming an n:recurse tag can either contain an empty body or another n:recurse tag, which strategy allows the tag handler for n:recurse to output the nesting depth of the deepest n:recurse tag?()  

题型:单项选择题

Which is the true choice about the web container request processing model()?

题型:单项选择题

Which two are true?()

题型:多项选择题

Which path, relative to a web application’s root, identifies the web application’s deployment descriptor?()

题型:单项选择题

Which the two are valid and equivalent?()

题型:多项选择题

A web application uses the HttpSession mechanism to determine if a user is “logged in”. When a user supplies a valid user name and password, an HttpSession is created for that user. The user has access to the application for only 15 minutes after logging in. The code must determine how long the user has been logged in, and if this time is greater than 15 minutes, must destroy the HttpSession. Which method in HttpSession is used to accomplish this?()

题型:单项选择题