单项选择题


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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题


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.

2.单项选择题


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.

3.单项选择题


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.

4.单项选择题


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.

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

6.单项选择题

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.

7.单项选择题

1. class A { 
3. public String to String() { 
4. return “4”; 
5. } 
6. } 
7. class B extends A { 
8. public String toString() {
9. return super.toString() + “3”; 
10. } 
11. } 
12. public class Test { 
13. public static void main (String[] args) { 
14. System.out.printIn(new B());
15. } 
16. }  
What is the result()?  
 

A. Compilation succeeds and 4 is printed.
B. Compilation …………… is printed.
C. An error on line 9 cause compilation to fail.
D. An error on line 14 cause compilation to fail.
E. Compilation succeeds but an exception is thrown at line 9.

8.多项选择题

Given: 
1. public class Method Over { 
2. public void set Var (int a, int b, float c) { 
3. } 
4. }  
Which two overload the set Var method()?

A. private void set Var(int a, float c, int b) {}
B. protected void set Var(int a, int b, float c) {}
C. public int set Var(int a, float c, int b) {return a:}
D. public int set Var(int a, int b, float c) {return a:}
E. protected float set Var(int a, int b, float c) {return c:}

9.多项选择题Which two choices are equivalent?()

A. 16 > 4
B. 16 / 2
C. 16 * 4
D. 16 >> 2
E. 16 / 22
F. 16 >>> 2

10.多项选择题

AnInterface is an interface. AnAdapter0 is a non-abstract, non-final class with a zero argument constructor. An Adapterl is a non-abstract, non-final class without a zero argument constructor, but with a constructor that takes one int argument.  
Which two construct an anonymous inner class()?

A. AnAdapter1 aa = new AnAdapter1 () {}
B. AnAdapter0 aa = new AnAdapter0 () {}
C. AnAdapter0 aa = new AnAdapter0 (5) {}
D. AnAdapter1 aa = new AnAdapter1 (5) {}
E. AnInterface ai = new Anlnterface (5)) {}

最新试题

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

题型:单项选择题

Which two are true?()

题型:多项选择题

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?()

题型:单项选择题

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

题型:单项选择题

Which two are true()

题型:多项选择题

Assume session is an HttpSession, and is not referenced anywhere else in ServletA. Which two changes, taken together, ensure that value is equal to “Hello” on line 23? ()

题型:多项选择题

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

题型:单项选择题

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? ()

题型:单项选择题

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?()  

题型:单项选择题

Which the two are true regarding a web application class loader?()

题型:多项选择题