网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
多选题
Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()
A
final int k = 4:
B
public int k = 4:
C
static int k = 4:
D
private int k = 4:
E
abstract int k = 4:
F
volatile int k = 4:
G
transient int k = 4:
H
protected int k = 4:
参考答案
参考解析
解析:
暂无解析
更多 “多选题Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()Afinal int k = 4:Bpublic int k = 4:Cstatic int k = 4:Dprivate int k = 4:Eabstract int k = 4:Fvolatile int k = 4:Gtransient int k = 4:Hprotected int k = 4:” 相关考题
考题
Given:1.%int[]nums={42,420,4200};2.request.setAttribute(foo,nums);%3.${5+3lt6}4.${requestScope[’foo’][0]ne10div0}5.${10div0}Whatistheresult?()
A.TruetrueB.FalsetrueC.Falsetrue0D.TruetrueInfinityE.FalsetrueInfinity
考题
Given:Which code, inserted at line 15, allows the class Sprite to compile?()
A.Foo { public int bar() { return 1; }B.new Foo { public int bar() { return 1; }C.new Foo() { public int bar() { return 1; }D.new class Foo { public int bar() { return 1; }
考题
public interface Foo{ int k = 4; } Which three are equivalent to line 2?() A、 Final int k = 4;B、 Public int k = 4;C、 Static int k = 4;D、 Private int k = 4;E、 Abstract int k = 4;F、 Volatile int k = 4;
考题
1. public class Target { 2. private int i = 0; 3. public int addOne() { 4. return ++i; 5. } 6. } And: 1. public class Client { 2. public static void main(String[] args) { 3. System.out.println(new Target().addOne()); 4. } 5. } Which change can you make to Target without affecting Client?() A、 Line 4 of class Target can be changed to return i++;B、 Line 2 of class Target can be changed to private int i = 1;C、 Line 3 of class Target can be changed to private int addOne() {D、 Line 2 of class Target can be changed to private Integer i = 0;
考题
1. public interface A { 2. public void doSomething(String thing); 3. } 1. public class AImpl implements A { 2. public void doSomething(String msg) { } 3. } 1. public class B { 2. public A doit() { 3. // more code here 4. } 5. 6. public String execute() { 7. // more code here 8. } 9. } 1. public class C extends B { 2. public AImpl doit() { 3. // more code here 4. } 5. 6. public Object execute() { 7. // more code here 8. } 9. } Which statement is true about the classes and interfaces in the exhibit?() A、 Compilation will succeed for all classes and interfaces.B、 Compilation of class C will fail because of an error in line 2.C、 Compilation of class C will fail because of an error in line 6.D、 Compilation of class AImpl will fail because of an error in line 2.
考题
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:}
考题
public interface Foo { int k = 4; 3. } Which three are equivalent to line 2?()A、 final int k = 4;B、 public int k = 4;C、 static int k = 4;D、 abstract int k = 4;E、 volatile int k = 4;F、 protected int k = 4;
考题
Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()A、 final int k = 4:B、 public int k = 4:C、 static int k = 4:D、 private int k = 4:E、 abstract int k = 4:F、 volatile int k = 4:G、 transient int k = 4:H、 protected int k = 4:
考题
1. class SuperFoo { 2. SuperFoo doStuff(int x) { 3. return new SuperFoo(); 4. } 5. } 6. 7. class Foo extends SuperFoo { 8. //insert code here 9. } 下面哪三项分别插入到第8行,可以编译?()A、int doStuff() { return 42; }B、int doStuff(int x) { return 42; }C、Foo doStuff(int x) { return new Foo(); }D、SuperFoo doStuff(int x) { return new Foo(); }
考题
Given: 1. public class ConstOver { 2. public constOver(int x, int y, int z) { 3. } 4. } Which two overload the ConstOver Constructor?()A、 ConstOver() {}B、 protected int ConstOver(){}C、 private ConstOver(int z, int y, byte x ) {}D、 public Object ConstOver(Int x, int y, int z) {}E、 pubic void ConstOver (byte x, byte y, byte z) {}
考题
1. public class Test { 2. int x= 12; 3. public void method(int x) { 4. x+=x; 5. System.out.println(x); 6. } 7. } Given: 34. Test t = new Test(); 35. t.method(5); What is the output from line 5 of the Test class?() A、 5B、 10C、 12D、 17E、 24
考题
Given 1. public class Foo { 2. public static void main (String [] args) } 3. try { return;} 4. finally { Syste.out.printIn (“Finally”);} 5. } 6. } What is the result( )?A、 The program runs and prints nothing.B、 The program runs and prints “Finally”.C、 The code comiles. But an exception is thrown at runtime.D、 The code will not compile because the catch block is missing.
考题
public interface Foo{ int k = 4; } Which three are equivalent to line 2? ()A、 Final int k = 4;B、 Public int k = 4;C、 Static int k = 4;D、 Private int k = 4;E、 Abstract int k = 4;F、 Volatile int k = 4;G、 Transient int k = 4;H、 Protected int k = 4;
考题
interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()A、 Compilation succeeds.B、 An error at line 2 causes compilation to fail.C、 An error at line 9 causes compilation to fail.D、 An error at line 10 causes compilation to fail.E、 An error at line 11 causes compilation to fail.
考题
1. public class A { 2. public String doit(int x, int y) { 3. return “a”; 4. } 5. 6. public String doit(int... vals) { 7. return “b”; 8. } 9. } Given: 25. A a=new A(); 26. System.out.println(a.doit(4, 5)); What is the result?() A、 Line 26 prints “a” to System.out.B、 Line 26 prints „b” to System.out.C、 An exception is thrown at line 26 at runtime.D、 Compilation of class A will fail due to an error in line 6.
考题
现有: 1. interface Altitude { 2. //insert code here 3. } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?() A、 0B、 1C、 2D、 3E、 4
考题
单选题interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()A
Compilation succeeds.B
An error at line 2 causes compilation to fail.C
An error at line 9 causes compilation to fail.D
An error at line 10 causes compilation to fail.E
An error at line 11 causes compilation to fail.
考题
多选题public interface Foo { int k = 4; 3. } Which three are equivalent to line 2?()Afinal int k = 4;Bpublic int k = 4;Cstatic int k = 4;Dabstract int k = 4;Evolatile int k = 4;Fprotected int k = 4;
考题
多选题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()?Aprivate void set Var(int a, float c, int b) {}Bprotected void set Var(int a, int b, float c) {}Cpublic int set Var(int a, float c, int b) {return a:}Dpublic int set Var(int a, int b, float c) {return a:}Eprotected float set Var(int a, int b, float c) {return c:}
考题
单选题10. interface Foo { int bar(); } 11. public class Sprite { 12. public int fubar( Foo foo) { return foo.bar(); } 13. public void testFoo() { 14. fubar( 15. // insert code here 16.); 17. } 18. } Which code, inserted at line 15, allows the class Sprite to compile?()A
Foo { public int bar() { return 1; } }B
new Foo { public int bar() { return 1; } }C
newFoo() { public int bar(){return 1; } }D
new class Foo { public int bar() { return 1; } }
考题
单选题1. interface foo { 2. int k = 0; 3. } 4. 5. public class test implements Foo ( 6. public static void main(String args[]) ( 7. int i; 8. Test test = new test (); 9. i= test.k; 10.i= Test.k; 11.i= Foo.k; 12.) 13.) 14. What is the result?()A
Compilation succeeds.B
An error at line 2 causes compilation to fail.C
An error at line 9 causes compilation to fail.D
An error at line 10 causes compilation to fail.E
An error at line 11 causes compilation to fail.
考题
多选题public interface Foo{ int k = 4; } Which three are equivalent to line 2? ()AFinal int k = 4;BPublic int k = 4;CStatic int k = 4;DPrivate int k = 4;EAbstract int k = 4;FVolatile int k = 4;GTransient int k = 4;HProtected int k = 4;
考题
多选题public interface Foo{ int k = 4; } Which three are equivalent to line 2?()AFinal int k = 4;BPublic int k = 4;CStatic int k = 4;DPrivate int k = 4;EAbstract int k = 4;FVolatile int k = 4;
考题
多选题Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()Afinal int k = 4:Bpublic int k = 4:Cstatic int k = 4:Dprivate int k = 4:Eabstract int k = 4:Fvolatile int k = 4:Gtransient int k = 4:Hprotected int k = 4:
考题
单选题Given 1. public class Foo { 2. public static void main (String [] args) } 3. try { return;} 4. finally { Syste.out.printIn (“Finally”);} 5. } 6. } What is the result( )?A
The program runs and prints nothing.B
The program runs and prints “Finally”.C
The code comiles. But an exception is thrown at runtime.D
The code will not compile because the catch block is missing.
考题
多选题Given: 1. public class ConstOver { 2. public constOver(int x, int y, int z) { 3. } 4. } Which two overload the ConstOver Constructor?()AConstOver() {}Bprotected int ConstOver(){}Cprivate ConstOver(int z, int y, byte x ) {}Dpublic Object ConstOver(Int x, int y, int z) {}Epubic void ConstOver (byte x, byte y, byte z) {}
考题
单选题现有: 1. interface Altitude { 2. //insert code here 3. } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?()A
0B
1C
2D
3E
4
考题
填空题1. public class test { 2. public static string output = “” 3. 4. public static void foo(int i) { 5. try { 6. if(i= =1) { 7. throw new Exception (); 8. } 9. output += “1”; 10.} 11. catch(Exception e) { 12. output += “2”; 13. return; 14.} 15. finally ( 16. output += “3”; 17. ) 18. output += “4”; 19. } 20. 21. public static void main (string args[]) ( 22. foo(0); 23. foo(1); 24. 25. ) 26. } What is the value of the variable output at line 24?()
热门标签
最新试卷