Myinterface
2015-10-01 17:38
369 查看
public class Computer { private int size; public Computer() { System.out.println("create a computer."); } public Computer(int size) { this(); this.size=size; } }
public interface Portable { public boolean isPortable(); }
public class PortableComputer extends Computer implements Portable{ public PortableComputer() { super(); } public PortableComputer(int mySize) { super(mySize); } public boolean isPortable() { return true; } }
public class TestPortable { public static void main(String [] args) { PortableComputer computer =new PortableComputer(); System.out.println("computer is portable?"+ computer.isPortable()); } }
相关文章推荐
- PowerDesigner V16.5 安装文件 及 破解文件
- phpmyadmin高级功能尚未完全设置部分功能未激活
- 下载:SQL Server 2016 CTP2.4 (x64) - DVD (English)
- 拷贝自身文件与获得系统信息
- 发现的最大数量
- Android - 采用ApiDemos得知Android开展
- 3617 Best Cow Line【贪心】
- 十一第五题 求数组最大和的子数组
- 黑马程序员——java学习笔记--反射机制
- ExtendAccount
- Dijkstra-POJ-2387-Til the Cows Come Home
- Java 选项卡面板
- MongoDB 数据模型设计
- 《Mahout实战》
- Aizu 2301 Sleeping Time(概率,剪枝)
- java学习笔记之反射
- QTableWidget 用法总结(只能使用标准的数据模型,并且其单元格数据是QTableWidgetItem的对象)
- web压力测试-pylot
- 关于项目刚才还能运行的,重启Myeclipse就不能运行(报错)的解决方法
- JAVA基础--db10_java多态-内部类