牛逼的java程序员写给老婆的情书(转载的)

  1. package kubi.coder.wife;

  2. /**
  3. * <p>
  4. * 这是一段Java程序写个他最爱的老婆的代码。<br>
  5. * 产生这个想法,是因为老婆要回老家几天,心里突然产生了无比依赖的感觉。<br>
  6. * 我现在只想对我的老婆说:<br>
  7. * <p>
  8. * <b>老婆,我爱你!</b>
  9. * </p>
  10. *
  11. * @author lihzh(苦逼coder)
  12. * @date 2012-5-25 下午9:23:11
  13. */
  14. public class 给最爱的老婆 {

  15. // 老婆是私有,全局唯一,不可更改继承的
  16. private static final class 老婆 {

  17. // 老婆,\r 代表换行
  18. private static final String 漂亮等级 = "世界上最美丽的\r";
  19. private static final String 温柔等级 = "世界上最温柔的\r";
  20. private static final String 勤劳等级 = "世界上最勤劳的\r";
  21. private static final String 善良等级 = "世界上最善良的\r";
  22. private static final String 可爱等级 = "世界上最可爱的\r";
  23. private static final String 懂我等级 = "世界上最懂我的\r";
  24. private static final String 疼我等级 = "世界上最疼我的\r";
  25. private static final String 照顾我等级 = "世界上最精心照顾我的\r";
  26. private static final String 对我的意义 = "你是我一生最爱的人\r";

  27. // 老婆是不能构造的,只能迎娶
  28. private 老婆() {
  29. }

  30. private static final 老婆 marryMe() {
  31. return new 老婆();
  32. }

  33. private boolean 笑() {
  34. System.out.println("老婆笑了:)");
  35. return true;
  36. }

  37. private boolean 哭() {
  38. System.out.println("呜呜,老婆伤心了。");
  39. return true;
  40. }

  41. private boolean 不在家() {
  42. System.out.println("老婆不在家。");
  43. return true;
  44. }

  45. private void 生气了() {
  46. throw new 老婆很生气Exception("老婆今天很生气,不爱理你。");
  47. }

  48. private void 破涕为笑() {
  49. System.out.println("老婆破涕为笑。");
  50. }

  51. @Override
  52. public String toString() {
  53. return "老婆你是:\r" + 漂亮等级 + 温柔等级 + 勤劳等级 + 善良等级 + 可爱等级
  54. + "你也是:\r" + 懂我等级 + 疼我等级 + 照顾我等级 + "总之,\r" + 对我的意义;
  55. }

  56. }

  57. /*
  58. * 老婆很生气异常
  59. */
  60. private static final class 老婆很生气Exception extends RuntimeException {

  61. private static final long serialVersionUID = 7260098074598571319L;

  62. private 老婆很生气Exception(String msg) {
  63. super(msg);
  64. }
  65. }

  66. public static void main(String[] args) {
  67. 老婆 myWife = 老婆.marryMe();
  68. System.out.println("老婆,首先我想对你说:" + myWife);

  69. System.out.println("如果你笑,");
  70. if (myWife.笑()) {
  71. System.out.println("我更加高兴。\r");
  72. }

  73. System.out.println("如果你哭,");
  74. if (myWife.哭()) {
  75. System.out.println("我哄你笑。\r");
  76. }

  77. if (myWife.不在家()) {
  78. System.out.println("我就很难入睡。\r");
  79. }

  80. System.out.println("生活中难免有琐碎、摩擦。");
  81. try {
  82. myWife.生气了();
  83. } catch (老婆很生气Exception e) {
  84. System.out.println(e.getMessage());
  85. System.out.println("都是我的错,是我不好。请老婆不要生气。");
  86. } finally {
  87. System.out.println("直到....");
  88. myWife.破涕为笑();
  89. // 为了空行
  90. System.out.println();
  91. }

  92. int myAge = 28;
  93. // 爱你一万年
  94. while (myAge <= 10028) {
  95. boolean 我是否爱你 = true;
  96. myAge++;
  97. }

  98. System.out.println("希望能就这样平平静静的牵你手,一直走。");
  99. System.out.println("我爱你,我的老婆。");
  100. System.out.println("\t ——你的老公(苦逼coder)于:2012年5月25日晚");
  101. }

  102. }

运行后结果:

老婆,首先我想对你说:老婆你是:

世界上最美丽的

世界上最温柔的

世界上最勤劳的

世界上最善良的

世界上最可爱的

你也是:

世界上最懂我的

世界上最疼我的

世界上最精心照顾我的

总之,

你是我一生最爱的人

如果你笑,

老婆笑了:)

我更加高兴。

如果你哭,

呜呜,老婆伤心了。

我哄你笑。

老婆不在家。

我就很难入睡。

生活中难免有琐碎、摩擦。

老婆今天很生气,不爱理你。

都是我的错,是我不好。请老婆不要生气。

直到....

老婆破涕为笑。

希望能就这样平平静静的牵你手,一直走。

我爱你,我的老婆。


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值