单选题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.

单选题
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.


参考解析

解析: 暂无解析

相关考题:

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

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.

1. public class X {  2. public static void main (String[]args)   {  3. int [] a = new int [1]  4. modify(a);  5. System.out.printIn(a[0]);  6. }  7.    8. public static void modify (int[] a)  {  9.   a[0] ++;  10.    } 11. }       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 causes compilation to fail.

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.% int[] nums = {42,420,4200}; 2.request.setAttribute("foo", nums); % 3.${5 + 3 lt 6} 4.${requestScope[’foo’][0] ne 10 div 0} 5. ${10 div 0} What is the result?()A、True trueB、False trueC、False true 0D、True true InfinityE、False true Infinity

1. public class test (  2. public static void main(string args[]) {  3. int 1= 0;  4. while (i)  {  5. if (i==4) {  6. break;  7. }  8. ++i;  9. }  10.    11. }  12. )   What is the value of i at line 10?()A、 0B、 3C、 4D、 5E、 The code will not compile.

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 Blip {  2. protected int blipvert(int x) { return 0; }  3. }  4. class Vert extends Blip {  5. // insert code here  6. }  Which five methods, inserted independently at line 5, will compile?()  A、 public int blipvert(int x) { return 0; }B、 private int blipvert(int x) { return 0; }C、 private int blipvert(long x) { return 0; }D、 protected long blipvert(int x, int y) { return 0; }E、 protected int blipvert(long x) { return 0; }F、 protected long blipvert(long x) { return 0; }G、protected long blipvert(int x) { return 0; }

现有:   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.

多选题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行,可以编译?()Aint doStuff() { return 42; }Bint doStuff(int x) { return 42; }CFoo doStuff(int x) { return new Foo(); }DSuperFoo doStuff(int x) { return new Foo(); }

多选题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;

多选题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:

单选题1. public class test (  2. public static void main(string args[]) {  3. int 1= 0;  4. while (i)  {  5. if (i==4) {  6. break;  7. }  8. ++i;  9. }  10.    11. }  12. )   What is the value of i at line 10?()A 0B 3C 4D 5E The code will not compile.

单选题现有:  1.  interface Animal  f      2.    void eat();      3.    }      4.  5.  // insert code here      6.  7. public class HouseCat implements Feline  {      8.    public void eat()    {  }     9.  }  和以下三个接口声明:  interface Feline extends Animal  (  )  interface Feline extends Animal  {void eat();    }  interface Feline extends Animal  {void eat()    {  }  }   分别插入到第5行,有多少行可以编译?A  0B  1C  2D  3

单选题1. interface Animal {   2. void eat();   3. }   4.   5. // insert code here   6.   7. public class HouseCat implements Feline {   8. public void eat() { }   9. }   和以下三个接口声明:   interface Feline extends Animal { }   interface Feline extends Animal { void eat(); }   interface Feline extends Animal { void eat() { } }   分别插入到第 5 行,有多少行可以编译?()A0B1C2D3

单选题现有:   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 Blip {  2. protected int blipvert(int x) { return 0; }  3. }  4. class Vert extends Blip {  5. // insert code here  6. }  Which five methods, inserted independently at line 5, will compile?()Apublic int blipvert(int x) { return 0; }Bprivate int blipvert(int x) { return 0; }Cprivate int blipvert(long x) { return 0; }Dprotected long blipvert(int x, int y) { return 0; }Eprotected int blipvert(long x) { return 0; }Fprotected long blipvert(long x) { return 0; }Gprotected long blipvert(int x) { return 0; }

填空题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?()