10.classLine{11.publicclassPoint{publicintx,y;}12.publicPointgetPoint(){returnnewPoint();}13.}14.classTriangle{15.publicTriangle(){16.//insertcodehere17.}18.}Whichcode,insertedatline16,correctlyretrievesalocalinstanceofaPointobject?()A.Pointp=Line.getPoint();B.Line.Pointp=Line.getPoint();C.Pointp=(newLine()).getPoint();D.Line.Pointp=(newLine()).getPoint();

10.classLine{11.publicclassPoint{publicintx,y;}12.publicPointgetPoint(){returnnewPoint();}13.}14.classTriangle{15.publicTriangle(){16.//insertcodehere17.}18.}Whichcode,insertedatline16,correctlyretrievesalocalinstanceofaPointobject?()

A.Pointp=Line.getPoint();

B.Line.Pointp=Line.getPoint();

C.Pointp=(newLine()).getPoint();

D.Line.Pointp=(newLine()).getPoint();


相关考题:

在如下源代码文件Test.java中, 哪个是正确的类定义?() A.public class test { public int x = 0; public test(int x) { this.x = x; } }B.public class Test{ public int x=0; public Test(int x) { this.x = x; } }C.public class Test extends T1, T2 { public int x = 0; public Test (int x) { this.x = x; } }D.public class

1.importjava.io.*;2.publicclassFooimplementsSerializable{3.publicintx,y;4.publicFoo(intx,inty){this.x=x;this.y=y;}5.6.privatevoidwriteObject(ObjectOutputStreams)7.throwsIOException{8.s.writeInt(x);s.writeInt(y)9.}10.11.privatevoidreadObject(ObjectInputStreams)12.throwsIOException,ClassNotFoundException{13.14.//insertcodehere15.16.}17.}Whichcode,insertedatline14,willallowthisclasstocorrectlyserializeand deserialize?()

classLine{11.publicstaticclassPoint{}12.}13.14.classTriangle{15.//insertcodehere16.}Whichcode,insertedatline15,createsaninstanceofthePointclassdefinedinLine?() A.Pointp=newPoint();B.Line.Pointp=newLine.Point();C.ThePointclasscannotbeinstatiatedatline15.D.Line1=newLine();1.Pointp=new1.Point();

在下列源代码文件Test.java中,正确定义类的代码是( )。A.pblic class test { public int x=0; public test(int x) { this. x=x;} }B.public class Test { public int x=0; public Test(int x) { this. x=x;} }C.public class Test extends T1,T2{ public int x = 0; public Test(int x){ this. x = x; } }D.protected class Test extends T2{ public int x = 0; public Test(int x) { this. x = x; } }

在下列源代码文件Test.java中, ( )是正确的类定义。A.public class test{B.public class Test{ public int x=0;public int x=0; public test (intx) public Test (int x){ {this.x=x; this.x=x;} }} }C.public class Test extends T1,T2{D.protected class Test extends T2{ public int=0;public int x=0; public Test(int x){Public Test (int x){ this.x=x;this.x=x: }} }}

在下列源代码文件Test.java中,哪个选项是正确的类定义?A.public class test{ public int x=0; public test(int x ) { this.x=x; } }B.public class Test { public int x=0; public Test(int x ) { this.x=x; } }C.public class Test extends T1 T2 { public int x=0; public Test(int x){ this.x=x; } }D.protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }

在下列源代码文件Test.java中,哪个选项是正确的类定义? ( )A.public class test { public int x=0; public test(int x) { this.x=x; } }B.public class Test { public int x=0; public Test(int x) { this.x=x; } }C.public class Test extends Ti,T2 { public int x=0; public Test(int x) { this.x=x; } }D.protected class Test extends T2 { public int x=0; public Test(int x) { this.x=x; } }

下列方法定义中,方法头不正确的是:A.public static x(double a){ … }B.public static int x(double y){ … }C.void x(double d) { … }D.public int x(){ … }

下列方法定义中,方法头不正确的是()。A.public static x(double a){…}B.public static int x(double y){…}C.void x(double d){…}D.public int x(){…}