1.This
public class This {
int a,b,c;
This(){
System.out.println("正要new一个Hello对象");
}
This(int a,int b){
this();
a = a;
this.a = a;
this.b = b;
}
This(int a,int b,int c){
this(a,b);
this.c = c;
}
void sing(){}
void chifan(){
this.sing();
System.out.println("你妈妈喊你回家吃饭!");
}
public static void main(String[] args){
This hi = new This(2,3);
hi.chifan();
}
}
2.ThisDemo
public class ThisDemo {
String name;
int age;
public ThisDemo(){
}
public ThisDemo(String name){
this.name = name;
}
public ThisDemo(String name,int age){
this(name);
this.age = age;
}
public void test1(){
System.out.println