以下有关类的继承的叙述中,正确的是
(A)子类能直接继承父类所有的非私有属性,也可通过接口继承父类的私有属性
(B)子类只能继承父类的方法,不能继承父类的属性
(C)子类只能继承父类的非私有属性,不能继承父类的方法
(D)子类不能继承父类的私有属性
参考答案
继续答题:下一题


更多java基础知识试题
- 1在Java中,以下变量赋值无法通过编译的是
- 2下列哪个类声明语句是正确的( )
- 3下列关于J K、JRE和JVM关系的描述中,正确的是( )
- 4哪个修饰符定义了方法与属性只能在同一个类中访问?
- 5. 问题以下输出是什么 ?class ChangeIt{ static void doIt( int[] z ) { int[] A = z; A[0] = 99; }}class TestIt{ public static void main( String[] args ) { int[] myArray = {1, 2, 3, 4, 5}; ChangeIt.doIt(myArray); for (int i = 0; i < myArray.length; i++) { System.out.print(myArray[i] + " "); } }}