- 论坛徽章:
- 0
|
class aclass {
public void aclassprint(){
System.out.println("hello,this is the frist class");
}
}
class bclass extends aclass{
/*blic aclassprint(){
System.out.println("hello,this is the secend");
}*/
public void f(){
System.out.println("aaaa");
}
}
public class test{
public static void main(String args[])
{
bclass t=new bclass();
aclass te=new aclass();
//te.f();
t.f();
t.aclassprint();
}
}
/*子类继承父类 那么就说明子类具有其父类的所有面貌特称和行为
但是父类对象则不同*/
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/43218/showart_339717.html |
|