day3--面向对象--interface
2015-07-18 11:44
507 查看
package day04; class Animal2{ private String name; private int age; public Animal2(String name, int age) { this.name = name; this.age = age; } public void say() { System.out.println(name + "," + age); } } interface Bellow { public void bellow(); } interface Work { public void work(); } class Dog1 extends Animal2 implements Bellow, Work { public Dog1() { super("狗", 1); } public Dog1(String name, int age) { super(name, age); } public void bellow() { System.out.println("汪汪汪"); } public void work() { System.out.println("看家"); } } public class Demo6 { public static void main(String[] args) { Dog1 d=new Dog1(); d.bellow(); d.work(); } }
相关文章推荐
- 匿名马来西亚调查人员:机长系客机…
- 都教授千颂伊是河南情侣 韩国…
- 关于日本,太犀利了!!!
- 利用QTP TextUtil对象获取图片验证码
- 点滴积累,水滴石穿,非一日之功!
- Android 使用AIDL调用外部服务
- 共模滤波器
- 节日 连连
- 《教师节》!
- 2010年08月17日的日记
- iOS 读取图片的各种方法
- 用户管理系统调用
- codevs1013
- JavaScript引擎的工作原理
- 无显示仍然发挥树莓派——VNCserver设定
- SQL数据库语句练习题目
- [c++学习笔记]反汇编角度看变量名和引用作为函数参数
- 比如对 姓名字段,可以同时查询两个姓名的记录
- .NET方法中参数过多的解决方法
- 移动端Web上传图片实践