A user whose role is Admin can perform a PUT.
A user whose role is Admin can perform a GET.
A user whose role is Admin can perform a POST.
A user whose role is Member can perform a PUT.
A user whose role is Member can perform a POST.
A user whose role is Member can perform a GET.
第1题:
Given the web application deployment descriptor elements: 11.
第2题:
Given the following interface definition, which definitions are valid?() interface I { void setValue(int val); int getValue(); } DEFINITION a: (a) class a extends I { int value; void setValue(int val) { value = val; } int getValue() { return value; } } DEFINITION b: (b) interface b extends I { void increment(); } DEFINITION c: (c) abstract class c implements I { int getValue() { return 0; } abstract void increment(); } DEFINITION d: (d) interface d implements I { void increment(); } DEFINITION e: (e) class e implements I { int value; public void setValue(int val) { value = val; } }
第3题:
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()
第4题:
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
int foo() { /* more code here */ }
void foo() { /* more code here */ }
第5题:
response.setError(302);
response.sendError(302);
response.setStatus(302);
response.sendRedirect(302);
response.sendErrorRedirect(302);
第6题:
public class Employee implements Info extends Data { public void load(){/*dosomething*/} }
public class Employee extends Inf.implements Data{ public void load() {/*do something*/} }
public class Empl.yee implements Inf extends Data{ public void Data.1oad(){* do something*/} public void load(){/*do something*/} }
public class Employee extends Inf implements Data { public void Data.1oad() {/*do something*/) public void info.1oad(){/*do something*/} }
第7题:
any class
only the Target class
any class in the test package
any class that extends Target
第8题:
第9题:
<include/>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>include</dispatcher>
<filter-condition>INCLUDE</filter-condition>
<filter-condition>include</filter-condition>
第10题:
x.a2();
z.a2();
z.c1();
z.a1();
y.c1();
x.a1();
第11题:
An IllegalStateException is thrown at runtime.
An InvalidSessionException is thrown at runtime.
The string value=null appears in the response stream.
The string value=myAttributeValue appears in the response stream.
第12题:
0
1
2
3
第13题:
interface Data { public void load(); } abstract class Info { public abstract void load(); } Which class correctly uses the Data interface and Info class?()
第14题:
Given the HttpServlet code: getServletContext().setAttribute(“foo”, “value”); What is the result?()
第15题:
Given: 10. class One { 11. void foo() { } 12. } 13. class Two extends One { 14. //insert method here 15. } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第16题:
Cat is-a Jumper
Cat is-a Animal
Dog is-a Jumper
Dog is-a Animal
Beagle has-a Jumper
Cat has-a Animal
Beagle has-a Tail
第17题:
A user whose role is Admin can perform a PUT.
A user whose role is Admin can perform a GET.
A user whose role is Admin can perform a POST.
A user whose role is Member can perform a PUT.
A user whose role is Member can perform a POST.
A user whose role is Member can perform a GET.
第18题:
public class Employee extends Info implements Data { public void load() { /*do something*/ } }
public class Employee implements Info extends Data { public void load() { /*do something*/ } }
public class Employee extends Info implements Data { public void load() { /*do something */ } public void Info.load() { /*do something*/ } }
public class Employee implements Info extends Data { public void Data.load() { /*dsomething */ } public void load() { /*do something */ } }
public class Employee implements Info extends Data { public void load() { /*do something */ } public void Info.load(){ /*do something*/ } }
public class Employee extends Info implements Data{ public void Data.load() { /*do something*/ } public void Info.load() { /*do something*/ } }
第19题:
public class Circle implements Shape { private int radius; }
public abstract class Circle extends Shape { private int radius; }
public class Circle extends Shape { private int radius; public void draw(); }
public abstract class Circle implements Shape { private int radius; public void draw(); }
public class Circle extends Shape { private int radius;public void draw() {/* code here */} }
public abstract class Circle implements Shape { private int radius;public void draw() { / code here */ } }
第20题:
any class
only the Target class
any class in the test package
any class that extends Target
第21题:
正常
编译错误
运行错误
以上都不对
第22题:
import utils.*;
static import utils.*;
importutils.Repetition.*;
static importutils.Repetition.*;
import utils.Repetition.twice();
import static utils.Repetition.twice;
static import utils.Repetition.twice;
第23题:
Compilation will fail.
Compilation will succeed and the program will print “3”
Compilation will succeed but the program will throw a ClassCastException at line 6.
Compilation will succeed but the program will throw a ClassCastException at line 7.
第24题:
0
1
2
3