| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 545 人关注过本帖
标题:怎么结果是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
快速回复:怎么结果是0
数据加载中...
 
   



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

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