已知如下类说明: public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); // 程序代码… } } 如下哪个使用是正确的?() A.t.fB.this.nC.Test.mD.Test.n

已知如下类说明: public class Test { private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[]) { Test t = new Test(); // 程序代码… } } 如下哪个使用是正确的?()

A.t.f

B.this.n

C.Test.m

D.Test.n


相关考题:

有如下程序:includeusing namespace std;Class Test{public:Test(){n+=2;}~Test(){n- 有如下程序: #include<iostream> using namespace std; Class Test { public: Test() {n+=2;} ~Test() {n-=3;} static int getNum() {return n;} private: static int n; }; int Test::n=1; int main() { Test*p=new Test;A.n=0B.n=1C.n=2D.n=3

已知有下列类的说明,则下列哪个语句是正确的?public class Test { private float f=1.0f; int m=12; static int n=1; public static void main(String arg[]) { Test t= new Test(); }}A.t.f;B.this. nC.Test.m;D.Test.f;

已知有下列类的说明,则下列( )语句是正确的。 publicClass Test{ private float f=1.0f; int m=12; static int n=1: public static void main(Stringarg[]){ Test t=new Test(): } }A.t.f;B.this.n;C.Test.m;D.Test.f;

已知有下面的类说明: public class Test4 { private float f=1.0f; int m=12; static int n=1; public static void main(String args[]) { Test4 e=new Test4(); } } 在main()方法中,下面哪个的使用是正确的? ( )A.e.fB.this.nC.Test4.mD.Test4.f

已知有下列类的说明,则下列哪个语句是正确的? ( ) public class Test { private float f=1.0f; int m=2; static int n=1; public static void main(String arg[]) { Test t=new Test(); } }A.t.f;B.this,n;C.Test.m;D.Test.f;

已知有下列类的说明,则下列哪个语句是正确的? public class Test{ private float f = 1.0f; int m = 12; static int n=1; public static void main(String arg[ ]){ Test t = new Test( ); } }A.t.f;B.this.n;C.Test.m;D.Test.f;

如下程序编译时发生错误,错误的原因是show函数实现语句错误,则正确的语句应该为______。include<iostream.h>class test{private:int hum;public:test(int);void show( );};test::test(int n){num=n;}test::show( ){cout<<num<<endl;}void main( ){test T(10):T.show( );}

阅读以下说明和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();? ?}}

10、已知有下列类的说明,则下列哪个语句是正确的?() public class Test { private float f = 1.0f; int m = 12; static int n = 1; public static void main(String arg[]) { Test t = new Test(); } }A.t.f;B.this.n;C.Test.m;D.Test.f;