public class Overlay
{
public static void main(String args[])
{
int height=10;
Rectangle tt=new Rectangle();
tt.y=height;
tt.measure();
tt.print();}
}
class Shap
{
public Shap(int y) {
count = y;
} public int getCount() {
return count;
}
private int count;
public void measure(){
System.out.println("super_y="+y);}
void print(){
System.out.println("这是Shap的构造函数");}
}class Rectangle extends Shap
{
public Rectangle(int y)
{
super(y);
}
public void measure()
{
super.measure();
System.out.println("super_y="+y);
}}错误.....不知道怎么改~
{
public static void main(String args[])
{
int height=10;
Rectangle tt=new Rectangle();
tt.y=height;
tt.measure();
tt.print();}
}
class Shap
{
public Shap(int y) {
count = y;
} public int getCount() {
return count;
}
private int count;
public void measure(){
System.out.println("super_y="+y);}
void print(){
System.out.println("这是Shap的构造函数");}
}class Rectangle extends Shap
{
public Rectangle(int y)
{
super(y);
}
public void measure()
{
super.measure();
System.out.println("super_y="+y);
}}错误.....不知道怎么改~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货