/**
* this:当前的对象可以获取自己的属性或者方法
* super:当前的对象可以获取父类的属性或者方法
* @author
*
*/
//例子
public class Child extends Father{
public void test() {
//super:调用父类的方法
super.makeMoney();
//this:调用当前对象自己的方法
this.eat();
}
/**
* 吃
*/
public void eat() {
}
}
public class Father {
int age = 50;
final String color = "yellow";
/**
* 父类赚钱的方法
* @return
*/
public int makeMoney(){
int occount = 0;
System.out.println("老爸都是为我们赚钱");
return occount;
}
}