题目内容

在java中,可实现多继承效果的机制是( )。

A. 内部类
B. 重载
C. 抽象类
D. 接口

查看答案
更多问题

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

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. 错

答案查题题库