首页 > 其他 > 详细

This的使用

时间:2019-05-22 21:19:07      阅读:81      评论:0      收藏:0      [点我收藏+]

package testthis;

public class TestThis1 {
int a,b;
TestThis1(int a,int b){
this.a=a;
this.b=b;
System.out.println("a的值分别为:"+a);
System.out.println("b的值分别为:"+b);
}

void sing(){
}
void eat(){
this.sing();
System.out.println("你妈妈叫你回家吃饭");
}

public static void main(String[] args){
TestThis1 s1=new TestThis1(1,2);
s1.eat();
}
}

 

This的使用

原文:https://www.cnblogs.com/qq275316449-/p/10908435.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!