最終更新:2012-10-16 (火) 08:37:01 (4202d)
import static
Top / import static
- J2SE 5.0の新機能。
staticメンバを利用するときにクラス名を書かなくてよくなる。
import java.lang.Math; double pi = Math.PI;
import static java.lang.Math; double pi = PI:
構文
import static パッケージ名.クラス名.static変数名; import static パッケージ名.クラス名.staticメソッド名; import static パッケージ名.クラス名.*;