loading …

Archive

Posts Tagged ‘恶搞’

Java Code for Christmas

十二月 24th, 2009 edikud 5 Comments/216 hits

      刚刚和恺哥在Q上聊了一下关于Lonely Christmas的事,突然发现对于一个工科男生来说,使用程序代码来描述这个该死的鬼佬节日完全是可行的,于是乎就顺手敲出一段Java Code:

package edu.scut.emos.joke;

import java.util.Vector;
import edu.scut.emos.joke.human.Boy;
import edu.scut.emos.joke.human.Girl;


public class Christmas {
    public static void main(String[] args) {
        Boy me = new Boy("Haipeng");
        try {
            Vector<Girl> girls = me.findSomeGirls(); // Find the available girls
            Girl girl = girls.firstElement(); // Find the girl with highest priority
            me.niceChristmas(girl);
        } catch (NullPointerException e) { // It means the boy can not find a girl
            me.lonelyChristmas();
        } finally {
            me.christmasOver();
        }
    }
}

 

通常来讲,该程序的运行结果会是:

Lonely Christmas!! T_T
Christmas Over!! =_=

 

大家一起来YY~~哇咔咔~~