码迷,mamicode.com
首页 > 编程语言 > 详细

java的接口与继承和抽象

时间:2017-05-26 15:58:59      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:interface   support   pac   system   doc   抽象   package   nbsp   int   

package ClassInherit;

public interface IBook {
void WriteContent();
}

 

package ClassInherit;

public class AndroidBook extends Book implements IBook {

/* (non-Javadoc)
* @see ClassInherit.IBook#WriteContent()
*/
@Override
public void WriteContent() {
// TODO Auto-generated method stub
System.out.println("WriteAndroid");

}

public AndroidBook(String bookName, String author, int price) throws Exception {
super(bookName, author, price);
// TODO Auto-generated constructor stub
}

public AndroidBook() {
// TODO Auto-generated constructor stub
}

/* (non-Javadoc)
* @see ClassInherit.Book#doSeal()
*/
@Override
void doSeal() {
// TODO Auto-generated method stub
super.doSeal();
}

/* (non-Javadoc)
* @see ClassInherit.Book#getCount()
*/
@Override
public void getCount() {
// TODO Auto-generated method stub
//super.getCount();
System.out.println("安卓电子书");
}

public void SupportAndroid(){
System.out.println("SupportAndroid");
}

}

package ClassInherit;

public abstract class Sealer {

public Sealer() {
// TODO Auto-generated constructor stub
}
abstract void doSeal();

}

java的接口与继承和抽象

标签:interface   support   pac   system   doc   抽象   package   nbsp   int   

原文地址:http://www.cnblogs.com/linhongquan/p/6908620.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!