[Java] 纯文本查看 复制代码
public class BoNiu {
//姓名
String name;
//年龄
int age;
//胸围
String size;
public BoNiu() {
}
public BoNiu(String name, int age, String size) {
super();
this.name = name;
this.age = age;
this.size = size;
}
//inLove方法
public void inLove(Boy boy) {
System.out.println(age+"岁的胸围"+size+"的"+name+"疯狂的爱上了昌平吴彦祖"+boy.name);
}
}
class Boy {
//姓名
String name;
public Boy() {
}
public Boy(String name) {
super();
this.name = name;
}
}
public class Test {
public static void main(String[] args) {
new BoNiu("播妞",18,"36D").inLove(new Boy("_J2EE_LiXiZhen"));
}
}
来吧,想怎么new就怎么new |