网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
现有:  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.  }  和四个声明:   Foo doStuff (int x)  {  return new Foo();  }  Foo doStuff (int x)  {  return new SuperFoo();  }      SuperFoo doStuff(int x)  {  return new Foo();  }  SuperFoo doStuff(int y)  {  return new SuperFoo();  }    分别插入到第8行,有几个可以通过编泽?()
A

 1

B

 2

C

 3

D

 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.  }  和四个声明:   Foo doStuff (int x)  {  return new Foo();  }  Foo doStuff (int x)  {  return new SuperFoo();  }      SuperFoo doStuff(int x)  {  return new Foo();  }  SuperFoo doStuff(int y)  {  return new SuperFoo();  }    分别插入到第8行,有几个可以通过编泽?()A  1B  2C  3D  4” 相关考题
考题 现有如下程序段#include "stdio.h"int aa(int x,int y);main(){int a=24,b=16,c;c=aa(a,b);printf("%d\n",c);}int aa(int x,int y){int w;while(y){w=x%y;x=y;y=w;}return x;}则程序段的输出结果是A.8B.7C.6D.5

考题 下列带缺省值参数的函数说明中,正确的说明是 ______。A.int Fun(int x, int y=2,int z=3);B.int Fun(int x=1,int y,int z=3);C.int Fun(int x, int y=2,iht z);D.int Fun(int x=1,int y, int z=3);

考题 public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()A、Compilation fails.B、An exception is thrown at runtime.C、doStuff x=6 main x=6D、doStuff x=5 main x=5E、doStuff x=5 main x=6F、doStuff x=6 main x=5

考题 interface DeclareStuff{  public static final int EASY = 3;  void doStuff(int t); }  public class TestDeclare implements DeclareStuff {  public static void main(String [] args) {  int x=5;  new TestDeclare().doStuff(++x);  }  void doStuff(int s) {  s += EASY + ++s;  System.out.println(”s “ + s);  }  }  What is the result?() A、 s 14B、 s 16C、 s 10D、 Compilation fails.E、 An exception is thrown at runtime.

考题 现有:  class TestFoo f      int x;  String y;  int  getX()  {  return  x;  }     String getY()  {return y;  }      void setX (int  x)  {      int Z=7:      this.x=x;      }      可以添加多少个修饰符来封装此类?()     A、5B、4C、3D、2

考题 现有: 1.class Passer f 2.static final int X=5; 3.public static void main (String [] args) { 4.new Passer( ).go (x); 5.System. out .print (x); 6. ) 7.void go (int x) { 8.System. out .print(x++); 9.} 10.}结果是什么?()A、55B、56C、65D、66

考题 现有:  class Foo  {  public static void main (String  []  args)  {      int x=O;      int y=4;  for (int  z=0;  z3;  Z++;  X++)  {     if(x1++y10)    y++;    }  System. out .println (y);  }   }  结果是什么?()     A、7B、8C、10D、12

考题 Given the command line java Pass2 and:  public class Pass2 {  public void main(String [] args) {  int x=6;  Pass2 p = new Pass2();  p.doStuff(x);  System.out.print(” main x = “+ x); }  void doStuff(int x) {  System.out.print(” doStuffx = “+ x++);  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 doStuffx = 6 main x = 6D、 doStuffx = 6 main x = 7E、 doStuffx = 7 main x = 6F、 doStuffx = 7 main x = 7

考题 public class Pass {  public static void main(String [1 args) {  int x 5;  Pass p = new Pass();  p.doStuff(x);  System.out.print(” main x = “+ x);  }  void doStuff(int x) {  System.out.print(” doStuff x = “+ x++);  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 doStuffx = 6 main x = 6D、 doStuffx = 5 main x = 5E、 doStuffx = 5 main x = 6F、 doStuffx = 6 main x = 5

考题 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(); }

考题 Which two code fragments are most likely to cause a StackOverflowError?()A、int []x = {1,2,3,4,5};for(int y = 0; y  6; y++)    System.out.println(x[y]);B、static int[] x = {7,6,5,4};static { x[1] = 8;x[4] = 3; }C、for(int y = 10; y  10; y++)doStuff(y);D、void doOne(int x) { doTwo(x); }void doTwo(int y) { doThree(y); }void doThree(int z) { doTwo(z); }E、for(int x = 0; x  1000000000; x++) doStuff(x);F、void counter(int i) { counter(++i); }

考题 单选题现有:  Public/project]class TestFoo {   int x;   String y;   int getX() { return x; } (4,5,6是方法)   String getY() { return y; }   void setX(int x) {   int z = 7;   this.x = x;   }   }   Private代表属性封装可以添加多少个修饰符来封装此类?()A 2B 3C 4D 5

考题 单选题Given the command line java Pass2 and: What is the result? ()A  doStuff x = 6 main x = 6B  Compilation fails.C  doStuff x = 6 main x = 7D  An exception is thrown at runtime.E  doStuff x = 7 main x = 6F  doStuff x = 7 main x = 7

考题 多选题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 class Pass {  public static void main(String [1 args) {  int x 5;  Pass p = new Pass();  p.doStuff(x);  System.out.print(” main x = “+ x);  }  void doStuff(int x) {  System.out.print(” doStuff x = “+ x++);  }  }  What is the result?()A  Compilation fails.B  An exception is thrown at runtime.C  doStuffx = 6 main x = 6D  doStuffx = 5 main x = 5E  doStuffx = 5 main x = 6F  doStuffx = 6 main x = 5

考题 单选题Given the command line java Pass2 and: public class Pass2{ public void main(String[]args){ int x=6; Pass2 p=new Pass2(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()A Compilation fails.B An exception is thrown at runtime.C doStuffx=6 main x=6D doStuffx=6 mainx =7E doStuffx=7 mainx =6F doStuffx=7 mainx =7

考题 单选题1. interface DoStuff2 {  2. float getRange(int low, int high); }  3.  4. interface DoMore {  5. float getAvg(int a, int b, int c); }  6.  7. abstract class DoAbstract implements DoStuff2, DoMore { }  8.  9. class DoStuff implements DoStuff2 {  10. public float getRange(int x, int y) { return 3.14f; } }  11.  12. interface DoAll extends DoMore {  13. float getAvg(int a, int b, int c, int d); }  What is the result?()A  The file will compile without error.B  Compilation fails. Only line 7 contains an error.C  Compilation fails. Only line 12 contains an error.D  Compilation fails. Only line 13 contains an error.E  Compilation fails. Only lines 7 and 12 contain errors.F  Compilation fails. Only lines 7 and 13 contain errors.G  Compilation fails. Lines 7, 12, and 13 contain errors.

考题 单选题interface DeclareStuff{  public static final int EASY = 3;  void doStuff(int t); }  public class TestDeclare implements DeclareStuff {  public static void main(String [] args) {  int x=5;  new TestDeclare().doStuff(++x);  }  void doStuff(int s) {  s += EASY + ++s;  System.out.println(”s “ + s);  }  }  What is the result?()A  s 14B  s 16C  s 10D  Compilation fails.E  An exception is thrown at runtime.

考题 单选题Given: What is the result?()A Compilation fails.B An exception is thrown at runtime.C doStuff x = 6 main x = 6D doStuff x = 6 main x = 7E doStuff x = 7 main x = 6

考题 单选题1.class SuperFo{   2. SuperFo doStuff(int x){   3.return new SuperFo()   4.}   5.}  6.   7.class Foo extends SuperFo{   8.//insert code here   9.}   和四个声明:   Foo doStuff(int x){return new Foo();}   Foo doStuff(int x){return new SuperFoo();}   SuperFoo doStuff(int x){return new foo();}   SuperFoo doStuff(int y){return new SuperFoo();}   分别插入到第8行,有几个可以通过编译 ()A 1B 2C 3D 4E 5

考题 单选题现有:  class TestFoo f      int x;  String y;  int  getX()  {  return  x;  }     String getY()  {return y;  }      void setX (int  x)  {      int Z=7:      this.x=x;      }      可以添加多少个修饰符来封装此类?()A 5B 4C 3D 2

考题 单选题现有:  1.class Over  {  2.int dolt (long x)  {  return 3;  }      3.  }      4.  5. class Under extends Over  {      6.//insert code here      7.  }  和四个方法:  short dolt (int y)  {  return 4;  }  int dolt(long Xr long y)  {  return 4;  }      private int dolt(short y)  {  return 4;  }     protected int dolt (long x)  {  return 4;  }      分别插入到第6行,有几个可以通过编译?()A   1B   2C   3D   4

考题 多选题Which two code fragments are most likely to cause a StackOverflowError?()Aint []x = {1,2,3,4,5};for(int y = 0; y  6; y++)    System.out.println(x[y]);Bstatic int[] x = {7,6,5,4};static { x[1] = 8;x[4] = 3; }Cfor(int y = 10; y  10; y++)doStuff(y);Dvoid doOne(int x) { doTwo(x); }void doTwo(int y) { doThree(y); }void doThree(int z) { doTwo(z); }Efor(int x = 0; x  1000000000; x++) doStuff(x);Fvoid counter(int i) { counter(++i); }

考题 多选题现有:  public  class  TestDemo{     private int X-2;      static int y=3;  public  void method(){      final int i=100;      int j  =10;     class Cinner {  public void mymethod(){      //Here     }     }     }     } 在Here处可以访问的变量是哪些?()AXByCjDi

考题 单选题现有:  class Banana2  f      static int X=2;  public static void main (String  []  args)  {     int X=2;   Banana2 b=new Banana2();     b.go(x);     }  static  {x+=x; }   void go (int x)  {    ++x;  System. out.println (x);    }         结果为:()A 7B 5C 3D 2

考题 单选题Given the command line java Pass2 and:  public class Pass2 {  public void main(String [] args) {  int x=6;  Pass2 p = new Pass2();  p.doStuff(x);  System.out.print(” main x = “+ x); }  void doStuff(int x) {  System.out.print(” doStuffx = “+ x++);  }  }  What is the result?()A  Compilation fails.B  An exception is thrown at runtime.C  doStuffx = 6 main x = 6D  doStuffx = 6 main x = 7E  doStuffx = 7 main x = 6F  doStuffx = 7 main x = 7

考题 单选题public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()A Compilation fails.B An exception is thrown at runtime.C doStuff x=6 main x=6D doStuff x=5 main x=5E doStuff x=5 main x=6F doStuff x=6 main x=5