本帖最后由 马铃薯 于 2015-2-14 17:24 编辑
- public class Father {
- int a=10;
- public void test(){
- System.out.println("father");
- }
- public static void main(String[] args) {
- Father f = new Children();
- f.test();
- System.out.println(f.a);
- }
- }
-
- class Children extends Father{
- int a=20;
- int b=10;
- public void test(){
- System.out.println("Children");
- }
- }
复制代码
回复可以看答案! 你答对了吗?
|
|