单项选择题


What is the result?()

A. the program runs and prints nothing.
B. The program runs and prints “Finally”.
C. The code compiles. But an exception is thrown at runtime.
D. the code will not compile because the catch block is missing.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题Which four types of object can be thrown using the throw statement?()

A. Error
B. Event
C. Object
D. Exception
E. Throwable
F. Runtime Exception

2.单项选择题


What is the result?()

A. Compilation will succeed.
B. Compilation will fail at line 5.
C. Compilation will fail at line 6.
D. Compilation will fail at line 14.
E. Compilation will fail at line 176.

3.单项选择题


Which statement at Point X on line 1 allows this code to compile and run?()

A.import java.io.PrintWtier;
B.include java.io.PrintWRiter;
C.import java.io.OutputStream Writer;
D.include java.io.OutputStream Writer;
E.No statement is needed.

4.单项选择题


What is the Result?()

A. baz has the value of “”.
B. baz has the value of null.
C. baz has the value of “red”
D. baz has the value of “blue”
E. baz has the value of “green”
F. The code does not compile.
G. the program throws an exception.

5.单项选择题


What is the value of b bat line 5()?

A. -1
B. 225
C. 127
D. Compilation will fail.
E. Compilation will succeed but the program will throw an exception at line 4.

6.单项选择题


What is the result?()

A. baz has a value of 0.
B. baz has a value of 1.
C. baz has the value of 2.
D. An exception is thrown.
E. The code will not compile.

7.单项选择题


Which statement is true()?

A. Compilation succeed and d take the value 253.
B. Line 5 contains an error that prevents compilation.
C. Line 5 throws an exception indicating “out of range”
D. Line 3 and 4 contain errors that prevent compilation.
E. The compilation succeed and d takes the value of 1.

8.单项选择题


What is the result()?

A. The program prints “0”.
B. The program prints “4”.
C. The program prints “8”.
D. The program prints “12”.
E. The code does not compile.

9.单项选择题


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 5 cause compilation to fail.
E. An error “possible undefined variable” at line 10 cause compilation to fail.

10.单项选择题

1. class A { 
2. public byte file Number () {
3. return l; 
4. } 
5. } 
6. 
7. Class B extends A { 
8. public short getNumber() { 
9.  return 2; 
10. } 
11. 
12. public short getNumber() { 
13. B b = new B(); 
14. System.out.printIn(b.getNumber()); 
15. } 
16. }  
What is the result()?  

A. Compilation succeeds and l is printed.
B. Compilation succeeds and 2 printed.
C. An error at line 8 cause compilation to fail.
D. An error at line 14 cause complication to fail.
E. Complication succeeds but an exception is thrown at line 14.

最新试题

A JSP page, current.jsp, is created to display the current weather report. The weather report is contained in a weather.html page that is rewritten every five minutes. Which line, appearing in current.jsp, ensures that the most recent version of weather.html is included whenever current.jsp is referenced?()

题型:单项选择题

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

题型:单项选择题

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

题型:多项选择题

A developer is designing a web application which extensively uses EJBs and JMS. The developer finds that there is a lot of duplicated code to build the JNDI contexts to access the beans and queues. Further, because of the complexity, there are numerous errors in the code. Which J2EE design pattern provides a solution for this problem?()

题型:单项选择题

A developer for the Company.com web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?()  

题型:单项选择题

What code, inserted at line 21, is called prior to a session being migrated to a different JVM assuming the web application containing MyExample is deployed in a container which supports distributed applications?()

题型:单项选择题

Given a web application in which the request parameter product ID contains a product identifier.Which two EL expressions evaluate the value of the product ID?()

题型:多项选择题

Which the three interfaces need to be declared in the web application deployment descriptor? ()

题型:多项选择题

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 two are true?()

题型:多项选择题