2 Star 0 Fork 0

BESTI.IS.JAVA2018/20165337

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
People.java 419 Bytes
Copy Edit Raw Blame History
yueyuan authored 7 years ago . di4zhou
public class People{
int leg,hand;
String name;
People(String s){
name=s;
this.init(); //可以省略this,即将this.init();写成init();
}
void init(){
leg=2;
hand=2;
System.out.println(name+"有"+hand+"只手"+leg+"条腿");
}
public static void main(String args[]){
People boshi=new People("布什"); //创建boshi时,构造方法中的this就是对象boshi
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/BESTI-IS-JAVA-2018/20165337.git
git@gitee.com:BESTI-IS-JAVA-2018/20165337.git
BESTI-IS-JAVA-2018
20165337
20165337
master

Search