日期:2014-05-20 浏览次数:20751 次
package demo1;
public class NewBook1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String bname;
int bid;
int bprice;
NewBook1()
{
bname="历史密码";
bid=32221;
bprice=32;
}
NewBook1(NewBook1 a)
{
bname=a.bname;
bid=a.bid;
bprice=a.brice;
}
NewBook1(String name,int id,int price)
{
bname=name;
bid=id;
bprice=price;
}
void print()
{
System.out.println("书名:"+bname+"序号:"+bid+"价格:"+bprice);
}
class Badder extends NewBook1
{
String badder;
Badder()
{
super();
badder="新世界出版社";
}
Badder(Badder b)
{
super(b);
badder=b.badder;
}
Badder(String x,int y,int z,String aa)
{
super(x,y,z);
badder=aa;
}
}
class text
{
public static void main(String args[])
{
Badder a1=new Badder();
Badder a2=new Badder("市委常委",21006,26,"中国工人出版社");
Badder a3=new Badder(a2);
System.out.println(a1.badder);
a1.print();
Systemout.println(a2.badder);
a2.print();
a3.print();
}
}
}
}