2008-12-14 ================================================================================ ■cry.php --- cry() . "
"; } ?> --- ■Pet.class.php --- name = $name; $this->feeling = $feeling; } /** * 名前を取得する。 * @return 名前 */ public function getName() { return $this->name; } /** * 感情を取得する。 * @return 感情 */ public function getfeeling() { return $this->feeling; } /** * その感情にあわせた泣き声を返す。 * @return 勘定にあわせた泣き声 */ public abstract function cry(); } ?> --- ■Dog.class.php --- name . " が " . self::$CRY[$this->feeling] . " と鳴いてます "; } } ?> --- ■Cat.class.php --- name . " が " . self::$CRY[$this->feeling] . " と鳴いてます "; } } ?> ---