打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
//Love.java 一个经典的爱情类
//Love.java


public class Love extends Thread implements Runnable
{human boy,girl;

public void Love(human boy,human girl)
{this.boy=boy;
this.girl=girl;
}

public void run()
{
if(boy.有房() && boy.有车())
{boy.setWife(girl);
boy.setNothing(true);
return;
}

while(girl.愿意等())
{
for(day=1; day<=365; day++)
{if(day.is情人节())
if(boy.hadGiveGirl玫瑰())
girl.感情++;
else
girl.感情--;
if(day.isGirls生日())
if(boy.hadGiveGirl玫瑰())
girl.感情++;
else
girl.感情--;
boy.拼命赚钱();
}

girl.年龄++;
boy.年龄++;
girl.感情--;

if(boy.有房() && boy.有车())
{boy.setWife(gril);
boy.setNothing(true);
return;
}

else if(boy.赚钱>100000 && girl.感情>
continue;

else
girl.setOwner(lookForAnotherBoy());
return;
}
girl.setOwner(lookForAnotherBoy());
}

public lookForAnotherBoy()
{ human another_boy;
int size=girl.追求者().getSize();
if(size==0) throw new 没有追求者Exception();
while(int i=0;i {another_boy=girl.追求者().getItem();
if(another_boy.有房()&&another_boy.有车())
return another_Boy;
}
throw new 我要独身Exception();
}

}
public class 同性恋 extends Love
{human boy,girl;

public void Love(human boy,human girl)
{this.boy=boy;
this.girl=girl;
}

public void run()
{
if( 性别相同 ) {
super.run();
}else {
return;
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
归纳Java中的Interface(接口)
从代理模式到Java反射机制 - 设计模式
Ioc介绍之Kiss版
Spring Core
springioc原理(一)
【JAVA学习笔记】-JAVA基础知识总结
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服