题目内容

以下的类(接口)定义中正确的是( )

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; }}

查看答案
更多问题

接口中能声明变量。

A. 对
B. 错

接口中能定义非抽象方法。

A. 对
B. 错

abstract类中也可以用private或protected来修饰。

A. 对
B. 错

子类想使用被子类隐藏的实例成员变量或实例方法,就需要使用关键字super。

A. 对
B. 错

答案查题题库