摘要: package com.xdf.exam; public class A { public String show(D d) { return " A ADN D"; } public String show(A a) { return " A ADN A"; } ***************** 阅读全文
posted @ 2017-12-13 10:22 水墨&丹青 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-12-13 10:19 水墨&丹青 阅读(91) 评论(0) 推荐(0) 编辑
摘要: package com.xdf.demo; public abstract class Animal { // 所有动物的父类 private String name; // 姓名 private String strain; // 品种 private char sex; // 性别 /** * 阅读全文
posted @ 2017-12-13 10:13 水墨&丹青 阅读(96) 评论(0) 推荐(0) 编辑
摘要: package com.whxiong.work06;/* * 动物类接口 */public interface Animal { /** * 动物的叫声 */ void shout();} /** * 狗狗类 * @author whx */ class Dog implements Animal 阅读全文
posted @ 2017-12-13 09:31 水墨&丹青 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2017-12-13 09:13 水墨&丹青 阅读(69) 评论(0) 推荐(0) 编辑
摘要: package com.whxiong.work05; import java.util.Scanner; import com.whxiong.work05_2.Friends;import com.whxiong.work05_2.Master; /** * 第五章课后习题测试类 * @para 阅读全文
posted @ 2017-12-11 09:41 水墨&丹青 阅读(83) 评论(0) 推荐(0) 编辑
摘要: package com.whxiong.work04; public abstract class Animal { private int age; public Animal(int age){ this.age=age; } public int getAge() { return age;  阅读全文
posted @ 2017-12-11 09:37 水墨&丹青 阅读(60) 评论(0) 推荐(0) 编辑
摘要: *********************************************** package com.xdf.demo; /** * 由 abstract修饰的方法 > 》抽象方法 * 01.必须位于抽象类中 * 02.必须没有方法体 * 03.必须被子类重写,除非子类也是抽象类  阅读全文
posted @ 2017-12-11 09:32 水墨&丹青 阅读(85) 评论(0) 推荐(0) 编辑
摘要: package com.whxiong.work04; public abstract class Animal { private int age; public Animal(int age){ this.age=age; } public int getAge() { return age;  阅读全文
posted @ 2017-12-08 12:18 水墨&丹青 阅读(90) 评论(0) 推荐(0) 编辑
摘要: package com.xdf.bean; /** * Student is a Person * Teacher is a Person * * 子类和父类满足 is a的关系! * 学生是人类 * 老师是人类 * 司机是人类 * * 继承使用的关键字是extends! * * 请问: * 一个人 阅读全文
posted @ 2017-12-08 11:55 水墨&丹青 阅读(144) 评论(0) 推荐(0) 编辑