下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new TeA.0B.1C.2D.3

下面程序的输出结果是什么? class C1{ static int j=0; public void method(int a){ j++; } } class Test extends C1{ public int method(){ return j++; } public void result(){ method(j); System.out.println(j+method()); } public static void main(String args[]){ new Te

A.0

B.1

C.2

D.3


相关考题:

以下程序输出正确的是_______ amovep(int *p,int (*a)[3],int n) { int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5}, {2,4,6}}; p=(int*)mallox(100) amovep)p,a,3); printf("%d%d\n",p[2],p[5]);free(p) }A.56B.25C.34D.程序错误

以下程序输出正确的是 ______。amovep(int *P,int(*A) [3],int n) {int i,j; for(i=0;i<n;i++ for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5},{2,4,6}}; p=(int*)malloc(100); amovep(p,a,3); printf("%d%d\n",p[2],p[5]);free(p); }A.56B.25C.34D.程序错误

下面程序的输出结果是______。 main() { int a[3][4]={1,3,5,7,9,11,13,15,17,19,21,23}; int(*p)[4]=a,i,j,k=0; for(i=0;i<3;i++) for(j=0;j<2;j++) k=p[i][j]; printf("%d\n",k); }A.17B.18C.19D.23

以下程序输出正确的是______。 amovep(int *p,int(*a)[3],int n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5},{2,4,6}}; p=(int*)malloc(100); arnovep(p,a,3); printf("%d%d\n",p[2],p[5];free(p); }A.56B.25C.34D.程序错误

有如下程序段#include "stdio.h"void fun(int *a,int *b,int *c,int *d,int *e){ int i,j,k,m; for(i=0;i *a;i++) for(j=0;j *b;j++)  for(k=0;k*c;k++)  for(m=0;m *d;m++)  ++*e;}main(){ int a=10,b=10,c=10,d=10,e=0; fun(a,b,c,d,e); printf("%d\n",e);} 则程序段的输出结果是A.10000 B.1000 C.100 D.0

以下程序输出正确的是______。 amovep(int *p,int(*a)[3],int n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++){ *p=a[i][j];p++;} } main() {int *p,a[3][3]={{1,3,5},{2,4,6}}; p=(int*)malloc(100); amovep(p,a,3); printf("%d%d\n",p[2],p[5]);free(p); }A.56B.25C.34D.程序错误

以下程序输出正确的是______。 amovep(int *p,int(*A) [3],int n) {int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++){ *p=a[i][j];p++} } main() {int *p,a[3][3]={{1,3,5},{2,4,6}}; p=(int*)malloc(100); amovep(p,a,3); printf("%d%d\n",p[2],p[5]);free(p); }A.56B.25C.34D.程序错误

阅读以下说明和Java程序,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下Java代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分接口、类及其关系如图5-1所示。【Java代码】interface?DrawCircle?{? //绘制圆形 public(1) ;}class?RedCircle?implements?DrawCircle?{? ?//绘制红色圆形???????public?void?drawCircle(int?radius,intx,?int?y)??{????????????System.out.println("Drawing?Circle[red,radius:"?+?radius?+",x:"?+?x?+?",y:"?+y+?"]");???????}}class?GreenCircle?implements?DrawCircle?{????//绘制绿色圆形??????public?void?drawCircle(int?radius,?int?x,int?y)?{???????????System.out.println("Drawing?Circle[green,radius:"?+radius+",x:?"?+x+?",y:?"?+y+?"]");??????}}abstract?class?Shape?{????//形状? protected? ? (2)???;? ? public?Shape(DrawCircle?drawCircle)?{? ?this.drawCircle=?drawCircle;? ? ? public?abstract?void?draw();}class?Circle?extends?Shape?{? //圆形? ?private?int?x,y,radius;? public?Circle(int?x,int?y,intradius,DrawCircle?drawCircle)?{? ?(3)???;? this.x?=?x;? ? ? this.y?=?y;? ?this.radius?=radius;? }? ? ?public?void?draw()?{? ? drawCircle.? ?(4)? ?;? ? ? }}public?class?DrawCircleMain?{? public?static?void?main(String[]?args)?{? Shape?redCircle=new?Circle(?100,100,10,? (5) );//绘制红色圆形? Shape?greenCircle=new?Circle(200,200,10,(6) );//绘制绿色圆形? ?redCircle.draw(); greenCircle.draw();? ?}}

阅读下列说明和C++代码,填写程序中的空(1)~(6),将解答写入答题纸的对应栏内。【说明】以下C++代码实现一个简单绘图工具,绘制不同形状以及不同颜色的图形。部分类及其关系如图6-1所示。【C++代码】#include?#include?using?namespace?std;class?DrawCircle?{??????//绘制圆形,抽象类? ? ? public: (1);//定义参数为?int?radius,?int?x,?inty? ?virtual~DrawCircle()?{?}};class?RedCircle:public?DrawCircle?{????//绘制红色圆形? ? ? ? public: void?drawCircle(intradius,?int?x,?int?y)?{cout??drawCircle?=?drawCircle;? }? ?virtual~shape()?{?}? public:? ?virtual?void?draw()?=?0;};class?Circle:public?Shape?{????//圆形? ? private:? ? ?int?x,y,radius;? ? public:? Circle(int?x,inty,int?radius,DrawCircle?*drawCircle)? (3)? {? this->x?=?x;? ?this->y?=?y;? ? this->radius?=?radius; }? ? ? public:? void?draw(){? drawCircle?-> (4); }};int?main(){Shape?*redCirclenew?Circle(100,100,10,????(5)????);//绘制红色圆形? Shape?*greenCircle=new?Circle(100,100,10, (6)??);//绘制绿色圆形redCircle >draw();? ?greenCircle?->draw();? ?return?0;}