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

题目内容 (请给出正确答案)
单选题
1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()
A

 Compilation fails.

B

 The code runs without exception.

C

 An exception is thrown at line 7.

D

 An exception is thrown at line 2.


参考答案

参考解析
解析: 暂无解析
更多 “单选题1.class TestSuper { 22.TestSuper(int i) { } 3. } 4.class TestSub extends TestSuper{ } 5.class TestAll { 6.public static void main (String [] args) { 7.new TestSub(); 8.} 9.} Which is true?()A  Compilation fails.B  The code runs without exception.C  An exception is thrown at line 7.D  An exception is thrown at line 2.” 相关考题
考题 下面程序段的输出结果是( )。 public class Test {public static void main(String args[]){ int[] a=new int[11]; int[] p=new int[4]; int k=5; for(int i= 1 ; i<= 10;i++) a[i]=i; for(int i=1 ; i<=3;i++) p[i]=a[i*i]; for(int i= 1 ;i<=3;i++) k=k+p[i]*2; System.out.println(k); }}A.37B.31C.33D.35

考题 下列语句中不是死循环的是( )。A.int i=10;B.for(int i=1;j 下列语句中不是死循环的是( )。A.int i=10;B.for(int i=1;jC.int i-0;D.int i=1:

考题 下列程序的输出结果是【】。include using namespace std;int main(){ int i=5; int int main(){int i=5;int r=i; r=7;cout<<i<<end1;return 0;}

考题 以下程序的执行结果是【】。 include int f(int b[],int n) { int i,r=1; for(i=0;i 以下程序的执行结果是【 】。include<iostream.h>int f(int b[],int n){int i,r=1;for(i=0;i<n;i++)r=r*b[i];return r;}void main(){int x,a[]={2,3,4,5,6,7,8,9};x=f(a,3);cout<<x<<endl;}

考题 include void main() int s=0 for(int i=l;i #includevoid main()int s=0for(int i=l;is十=i*icout}输出结果:

考题 下面函数的作用是【 】。int index(int x,int a[],int n){for(int i=0;i<n;i++){if(a[i]==x)return i;}return i;}

考题 有以下程序: include using namespace std; int f(int); int main() {int i;for(i=0; 有以下程序:include <iostream>using namespace std;int f(int);int main(){int i;for(i=0;i<5;i++)cout<<f(i)<<" ";return 0;}int f(int i){static int k=1;for(;i>0;i--)k+=i;

考题 classTestSuper{22.TestSuper(inti){}3.}4.classTestSubextendsTestSuper{}5.classTestAll{6.publicstaticvoidmain(String[]args){7.newTestSub();8.}9.}Whichistrue?() A.Compilationfails.B.Thecoderunswithoutexception.C.Anexceptionisthrownatline7.D.Anexceptionisthrownatline2.

考题 下面程序的结果【】。 include int f(int); void main() { int x=1,i; for (i=0; i 下面程序的结果【 】。include<iostream.h>int f(int);void main() {int x=1, i;for (i=0; i<3; i++)cout<<f(x)<<‘ ’ ;cout<<end1;}int f(int x){int y=1;static int z=3y++;z++;return (x+y+z);}

考题 设有数组定义: int a[] = {11, 22, 33, 44, 55, 6, 77, 88, 99};, 则执行下列几个语句后的输出结果是______、______和______。for(int i = O; i < a.tength; i++)if(a[i]%3.== 0) System.out.println(a[i]);

考题 若有以下程序:includeusing namespace std;int f(){ static int i=O; int s=1; s+=i; 若有以下程序: #include<iostream> using namespace std; int f() { static int i=O; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=f(); cout<<a<<endl; retrun 0; } 程序运行后,输出的结果是A.20B.24C.25D.15

考题 有以下程序:include define N 20fun(int a[] ,int n,int m){int i,j;for(i=m;i> :n;i 有以下程序: #include <stdio.h> #define N 20 fun(int a[] ,int n,int m) { int i,j; for(i=m;i> :n;i--) a[i+1] =a[i]; } main( ) { int i,a[N.] = 11,2.3,4,5,6,7,8,9,10[; fun( a,2,9) for(i =0;i<5;i ++ ) printf("% d" ,a[i] );程序运行后的输出结果是( )。A.10234B.12344C.12334D.12234

考题 下列程序的执行结果为【 】。inciudeint f(int i) { return + +i; }int g(int i) 下列程序的执行结果为【 】。inciude<iostream, h>int f(int i) { return + +i; }int g(int i){return ++i; }void main(){ int a, b;a=b=0;a+ =f(g(A) );b+=f(f(B) );cout<<%= "<<a<<", b="<<(b<<end1;}

考题 有以下程序:include void fun(iht * a,int i,int j){int t;if(i 有以下程序:#include <stdio, h>void fun(iht * a,int i,int j){ int t; if(i < j) { t=a[i];a[i] =a[j] ;a[j]=t; i++;j--; fun(a,i,j);main ( ) int x[ ]: {2,6,1,8} ,i; fun(x,0,3); for( i=0;i <4;i ++ ) printf( "%2d" ,x[i] ); printf(" \n");A.1268B.8621C.8162D.8612

考题 下面变量命名错误的是:A.int i;B.int i3;C.int _i;D.int 3i;

考题 分析以下程序的执行结果【】。include class S{ int A[10]; public: int operato 分析以下程序的执行结果【 】。include <iostream. h>class S{int A[10];public:int operator () (int);};int S: :operator() (int x) {return A[x];}void main() {S a;int i,j;for (i=0; i<10; i++)a(i)=i*2;for (i=0; i<10; i++)cout<<a(i)<<" ";cout<<end1; }

考题 下列有关指针的用法中错误的是( )。A.int i;int*ptr=i;B.int i;int*ptr;i=*ptr;C.int*ptr;ptr=0;D.int i=5;int*ptr;*ptri;

考题 下列有关指针的用法中,错误的是( )。A.int i;int *p=i;B. int i;int *p;i=*p;C. int *p;p=0;D.int i=5;int *p;p=i;

考题 若有以下程序:includeusing namespace std;int fun(){static int i=0;int s=1;s+=i;i 若有以下程序: #include<iostream> using namespace std; int fun() { static int i=0; int s=1; s+=i; i++; return s; } int main() { int i,a=0; for(i=0;i<5;i++) a+=fun(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是( )。A.20B.24C.26D.15

考题 下列语句中正确的是()。A.int * p;i=8; p=i;B.int * p,i; p=i;C.float * p;int i;p=i=8; p=i;B.int * p,i; p=i;C.float * p;int i;p=(float)i;D.float * p;cout<<* p;

考题 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;

考题 活动(i,j)的时间为tij,总时差为R(i,j),点i及点j的最早开始时刻为TE(i)和TE(j),最迟结束时间为TL(i)和TL(j),下列正确的关系式是()A、TLF(i,j)=TL(j)B、TLF(i,j)=TL(j)-tijC、TES(i,j)=TE(i)-tijD、R(i,j)=TLF(i,j)-TES(i,j)

考题 for( int i = min; i A、 init i = min;while( i  max ){}B、 int i = min;  do system.out.println(i++); } while( i max );C、 for (int i=min; iD、 for (int i=; i++

考题 对于变量的初始化,以下几种方法中错误的是() A、int a; for (int i=0;i《12;i++)       a=i;B、int a; if (true)         a=7;C、int a;  int b=a;D、int a=0;E、int a;   a=0;

考题 单选题工序(i,j)的最早开工时间TES(i,j)等于()A TE(i)B max{TEs(k)+tki}C TL(i)D min{TL(j)-tij}

考题 单选题for( int i = min; i  A  init i = min;while( i  max ){}B  int i = min;  do system.out.println(i++); } while( i max );C  for (int i=min; iD  for (int i=; i++

考题 单选题现有:  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