试试用JAVA程序写一封家书

2016-09-18  本文已影响539人  极客汪

采用面对对象接口编程写一份家书

家书内容包括:称谓、问候、内容、祝福、落款
爸妈永远是世界上最体谅你的人,动手写下你对父母的祝福吧,没你想象的那么难



我是快乐的分割线


工具:一台装了eclipse的PC机

效果图如下:

远方的爸妈辛苦了
国庆团圆日

_我贴上部分代码(有问题请留言)

//接口
public interface IHomeLetter {
    void writeTitle();
    void writeHello();
    void writeBoby();
    void writeGreeting();
    void writeSelf();
}
//HomeLetterWriter类
public class HomeLetterWriter {
    
    public void writer(HomeLetterImpl letter){
        letter.writeTitle();
        letter.writeHello();
        letter.writeBoby();
        letter.writeGreeting();
        letter.writeSelf();
    }       

}

要善于从枯燥的学习中寻找亮点,这样你才能坚持,才能乐此不疲!
-----我是小焱焱

推荐网站:传智播客

上一篇 下一篇

猜你喜欢

热点阅读