JAVA高手帮小弟个忙~感激

[复制链接]
查看11 | 回复1 | 2008-4-19 15:05:49 | 显示全部楼层 |阅读模式
//////////Test.javapublic class Test1{String x="";String y="";public Test1() {
this.x="10";
this.y="20";}public Test1(String x1,String y1) {
this.x=x1;
this.y=y1;}public String getX() {
return x;}public void setX(String x) {
this.x = x;}public String getY() {
return y;}public void setY(String y) {
this.y = y;}}//////////////Test2.javapublic class Test2 extends Test1{String z="";public Test2(){
}public Test2(String x,String y,String z){
super(x,y);
this.z=z;}public void print(){
System.out.println(super.x);
System.out.println(super.y);
System.out.println(z);}public static void main(String[]args){
Test2 t=new Test2("11","22","33");
t.print();}}
回复

使用道具 举报

千问 | 2008-4-19 15:05:49 | 显示全部楼层
高手啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行