标题:怎么结果是0
取消只看楼主
想你的天空
Rank: 2
等 级:新手上路
威 望:5
帖 子:610
专家分:0
注 册:2004-12-30
 问题点数:0 回复次数:0 
怎么结果是0

public class Square{
private double height;
private double weight;
private double surfaceArea;

public Square(double height,double weigth){
this.height=height;
this.weight=weight;
}
public void computeSurfaceArea(){
surfaceArea=getHeight() * getWeight();
}
public double getHeight(){
return height;
}
public double getWeight(){
return weight;
}
public double getSurfaceArea(){
return surfaceArea;
}

}
public class DemoSquare{
public static void main(String args[]){
Square square=new Square(3,4);

square.computeSurfaceArea();

System.out.println(square.getSurfaceArea());
}
}

搜索更多相关主题的帖子: 结果 
2006-03-26 16:59



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-52959-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.574301 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved