A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

回复赚钱的
回复 使用道具 举报

抽取的还不是很好,继续加油。
回复 使用道具 举报
看看看看看看
回复 使用道具 举报
君子无醉 来自手机 中级黑马 2015-6-10 00:15:23
704#
回帖领题
回复 使用道具 举报
初来乍到,还不懂怎么做。。。。
回复 使用道具 举报
领题~~~~
回复 使用道具 举报
我也来试一试
回复 使用道具 举报
答案已上传,请查收

Test.zip

33.85 KB, 下载次数: 101

评分

参与人数 1技术分 +1 收起 理由
王震阳老师 + 1 赞一个!

查看全部评分

回复 使用道具 举报
赞赞,领题
回复 使用道具 举报
领题                                         
回复 使用道具 举报
嗯。。。。。。。。。。。。。。。。。
回复 使用道具 举报
public class XiaoHong {
        public static void main(String[] args) {
                Father father = new Father("male");
                Mother mother = new Mother("female");

                father.jobA();
                father.jobB();
                mother.jobC();
                mother.jobD();

                Person xiaoHong = new Person("female", father, mother);

                System.out.println("小红 is a " + xiaoHong.sex);
        }        
}

class Person {
        String sex;

        public Person(String sex, Object Father, Object Mother) {
                this.sex = sex;
        }

        public Person(String sex) {
                this.sex = sex;
        }
}

class Mother extends Person implements JobC, JobD {

        public Mother(String sex) {
                super(sex);
        }

        public void jobC() {
                System.out.println("小红爸 works jobC");
        }

        public void jobD() {
                System.out.println("小红爸 works jobD");
        }
}        

class Father extends Person implements JobA, JobB {

        public Father(String sex) {
                super(sex);
        }

        public void jobA() {
                System.out.println("小红妈 works jobA");
        }

        public void jobB() {
                System.out.println("小红妈 works jobB");
        }
}

interface JobA {
        public void jobA();
}

interface JobB {
        public void jobB();
}

interface JobC {
        public void jobC();
}

interface JobD {
        public void jobD();
}


1.jpg (51.41 KB, 下载次数: 12)

1.jpg
回复 使用道具 举报
怎样领题呢
回复 使用道具 举报
看一看,学习。
回复 使用道具 举报
好想去大上海啊!环境条件很不错啊!{:2_42:}
回复 使用道具 举报
要向杨哥学习咯
回复 使用道具 举报
领题目。。。
回复 使用道具 举报
领技术分喽
回复 使用道具 举报
阳哥总是这么霸气。刚刚的。
回复 使用道具 举报
老规矩,回帖领题
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马