美文网首页
试试用JAVA程序写一封家书

试试用JAVA程序写一封家书

作者: 极客汪 | 来源:发表于2016-09-18 20:08 被阅读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();
        }       
    
    }
    

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

    推荐网站:传智播客

    相关文章

      网友评论

          本文标题:试试用JAVA程序写一封家书

          本文链接:https://www.haomeiwen.com/subject/gljgettx.html