void show(){
// this();//错误,在普通方法中,不能调用构造方法;
System.out.println("我叫:" + this.name);//可以访问本类的成员变量;
}
void fun(){
this.show();//可以访问本类的其它成员方法;
}
}
class ThisDemo
{
public static void main(String[] args)
{
Student stu = new Student("张三");
}
}
------------------------------------------------------super----------------------------------------
class Fu
{
int num = 10;
Fu(){
System.out.println("Fu的构造方法");
}
Fu(int n){
System.out.println("Fu的构造方法........."+n);
}
void show(){
System.out.println("Fu的show()");
}
}
class Zi extends Fu
{
Zi(){