(1+X)关于 this 的描述,哪一个是错误的( )?
A. this 可以用于区分成员变量和局部变量。
B. this 可以用于调用其他构造方法。
C. 在同一个构造方法中,可以使用两次 this() 调用其他两个构造方法。
D. 在使用 this 调用其他构造方法时,要避免多个构造方法之间的无限循环现象。
查看答案
(1+X)以下关于 this 和 super 的描述,哪一个是错误的( )?
A. this 和 super 都可以调用构造方法
B. this 可以调用当前类中的属性、方法
C. super 可以调用父类中的属性、方法
D. 可以在同一个构造方法中,同时使用 this 和 super 来调用其他的构造方法
给出以下不完整类:class Person{String name, department;int age;public Person(String n){ name = n;}public Person(String n, int a){ name = n; age = a;}public Person(String n, String d, int a){//给属性name、age赋值,比如: name = n; age = a;department = d;}}可取代注释部分位置内容达到注释的目标的是()。
A. Person(n, a);
B. this(Person(n, a));
C. this(n, a);
D. this(name,age);
this的作用包括()。
A. 调用本类的构造方法
B. 表示类中的数据成员
C. 调用本类的成员方法
D. 以上都是
Java中用于标识当前对象的关键字是()。
A. super
B. that
C. this
D. 以上都不是