2012-08-03から1日間の記事一覧
Javaのinstanceofのメモ class C {} class D extends C{} interface E {} class F implements E{} class G extends F{} public class Sample { public static void main(String[] args) { C c = new C(); System.out.println("c instanceof C:" + (c instanc…
Javaの可変長引数でこういうときどうなるんだ?ってふと思ったので、実行結果をメモ。 public class SampleVariable { public static void main(String[] args) { SampleVariable a = new SampleVariable(); a.show(); a.show(1); a.show(1, 2); a.show(1,2,…
Javaのstaticインポートのメモ import static java.lang.Math.E; import static java.lang.Math.PI; import static java.lang.Math.random; public class Sample { public static void main(String[] args) { System.out.println("普通のインポート"); Syste…