?php /** * @author bianjiang * @desc * 求圆的面积 * */ class Circle { public static $pi = 3.1415926; public static function area($r) { return self::$pi * $r * $r; } } $r = 3; echo Circle::area($r); ?> 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/10599/showart_233687.html
by liuxingyuyuni - php文档中心 - 2007-01-17 18:53:17 阅读(403) 回复(0)
静态块static block //c4:StaticBlock1.java //author:ZhangHongbin //This program is protected by copyright laws. //Static block. public class StaticBlock1 { static { System.out.println("static block"); } public static void main(String[] args) { } } /** 静态块是在类被调用到内存后就开始执行的,它和创建对象或者main方法都没有关系。 如果没有m...
我将数值字段类型设为:float,double,decimal(5,3)都不能输入如:0.001,0.002,0.003,0.004...小数 请问要输入上述小数MySQL的字段类型应设为什么类型????
?php /** * @author bianjiang * @todo 练习静态方法调用/ * @desc * 求最大值 */ class Math { public function Max($first, $second) { return ($first > $second)?$first:$second; } public static function Max3($first, $second, $third) { $one = self::Max($first, $second); $two = self::Max($secon...
?php /** * @author bianjiang * @todo 练习静态方法调用/ * @desc * 求最大值 */ class Math { public static function Max($first, $second) { return ($first > $second)?$first:$second; } public static function Max3($first, $second, $third) { $one = self::Max($first, $second); $two = self::Max...