多项选择题
在类继承中,静态方法的使用正确的是()
A.父类的静态方法,可以被子类继承
B.静态方法也是可以从super对象上调用的
C.静态方法不能被继承
D.父类静态方法的可以被覆盖
相关考题
-
多项选择题
静态方法的定义正确的是()
A.都会被实例继承
B.通过类来调用
C.如果静态方法包含this关键字,这个this指的是类,而不是实例
D.静态方法可以与非静态方法重名 -
多项选择题
有关this指向下列说法正确的是()
A.类的方法内部如果含有this,它默认指向类的实例
B.class Logger{printName(name=’there’){this.print(`Hello ${name}`);}print(text){console.log(text);}}const logger=new Logger();const{printName}=logger;printName();//Hello there
C.class Logger{printName(name=’there’){this.print(`Hello ${name}`);}print(text){console.log(text);}}const logger=new Logger();const{printName}=logger;printName();//TypeError:Cannot read property’print’of undefined;
D.可以用于任何地方 -
多项选择题
class Point {}Point.name根据提干选择合适的选项()
A.返回:"Point"
B.返回:undefined
C.name属性总是返回紧跟在class关键字后面的类名
D.报错,因为name属性没有定义
