Math是一个类,PI是Math里的一个静态常量,ctrl+点击鼠标左键看源码,你就懂了:
/**
* The <code>double</code> value that is closer than any other to
* <i>pi</i>, the ratio of the circumference of a circle to its
* diameter.
*/
public static final double PI = 3.14159265358979323846;
看完懂了吧,你要自己定义还是用别人帮你已经定义好的,看你需求了。 |