一封Java程序員的情書……
publicClassPerson(){
privateStringname;
publicPerson(Stringname){
this.name=name;
}
publicvoidsetName(Stringname){
this.name=name;
}
publicStringgetName(){
returnname;
}
}
publicClassLoveLetter(){
publicstaticvoiddoLoveYou(Personme,Personyou){
System.out.print(me.getName()+"love"+you.getName());
}
publicstaticvoidmain(String[]args){
while(true){
doLoveYou(newPerson("king"),newPerson("monitor"));
}
}
}
网友评论