流浪的翅膀

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年4月26日

摘要: function Polygon(iSliders){ //定义一个多边形 this.silders=iSliders;}Polygon.prototype.getArea=function(){ //为多边形定义一个去的面积的方法 return 0;}function Triangle(iBase,iHeight){ Polygon.call(this,3); //继承多边形对象 this.base=iBase; this.height=iHeight;}Triangle.prototype.getArea=function(){ //重写去的面积的方法 return 0.5*this.ba 阅读全文
posted @ 2011-04-26 16:40 流浪的翅膀 阅读(137) 评论(0) 推荐(0)