• 2021-04-14
    填写补充下述程序片段:public class Point() {int x...2个小括号中的内容}......}
  • this.x this.y

    内容

    • 0

      class Person {private int a;public int... // point x安排哪个语句合法?

    • 1

      下面代码中,没有定义内部类或者错误定义了内部类的是()。 A: public Class Line { int length; Class Point {//内部类代码}} B: public Class Line { public Point getPoint() { return new Point(){//内部类代码}; }} C: public Class Line { //外部类代码} Class Point {//内部类代码} D: public Class Line { public int calcLength() { Class Point {//内部类代码} }}

    • 2

      下列程序的输出结果是_________。 #include class point { public: point(int i,int j) {x=i;y=j;} void print() {cout<<'('< (5,7) (4,3) (9,10) (-5,-7) 10.61.5

    • 3

      如下A类的定义中,不可以使用new A( )创建对象的是 A: public class A { int x; double d; } B: public class A { int x; double d; public A(){ <br> } } C: public class A { int x; double d; public A(){ x = 1; d = 0.5; } } D: public class A { int x; double d; public A(int x,double d){ this.x = x;<br> this.d = d; } } E: public class A { int x; double d; public A(int x,double d){ this.x = x;<br> this.d = d; } public A( ){ <br> } }

    • 4

      以下的类(接口)定义中正确的是( ) A: public class A{ private int x; public getX(){ return x; }} B: public abstract class A{ private int x; public abstract int getX(); public int aMethod(){ return 0; }} C: public class A{ private int x; public abstract int getX();} D: public interface interfaceA{ private int x; public int getX(){ return x; }}