1. [PHP]代码
radius = $radius;
}
public function getArea() {
return $this->radius * $this->radius * pi();
}
}
class Square {
private $side = 0;
public function __construct($side) {
$this->side = $side;
}
public function getArea() {
return $this->side * $this->side;
}
}
$shape = Shape::getShape('circle', 10);
echo $shape->getArea();
echo "\n";
$shape = Shape::getShape('square', 2);
echo $shape->getArea();
echo "\n";
换物网站源码
一个基于ASP.NET+MSSQL实现的网站源码,包含一个网站的后台管理、前面展示、留言等常用功能,简单而功能完整,具有相当的学习意义。 采用面向对象模式开发,暂时没有超级管理员管理后台
下载