åæ¸ããæ°ããããã ãã©è¦å½ãããªãããæ¸ãã¦ããã¾ããã
PS> java -version java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode) PS> cat Main.java class Main { static {System.out.println("Hello");} } PS> javac Main.java PS> java Main ã¨ã©ã¼: ã¡ã¤ã³ã»ã¡ã½ãããã¯ã©ã¹Mainã§è¦ã¤ããã¾ããã次ã®ããã«ã¡ã¤ã³ã»ã¡ã½ãããå®ç¾©ãã¦ãã ããã public static void main(String[] args) PS>
ã¡ãªã¿ã« Java6 ã ã¨ã
PS> java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode) PS> javac Main.java PS> java Main Hello Exception in thread "main" java.lang.NoSuchMethodError: main PS>
mainã¡ã½ããã¯ç¡ãã£ã¦æããããã©å®è¡èªä½ã¯ã§ãããã§ãããã¼ã
æ¢ãã¦ã¿ãããã®Tweetã§ããã
URL 大å¤ã ï¼Java7ã§ã¯staticåæåãããã¯ã§å¦çãæ¸ãã·ã§ã¼ãã³ã¼ãã£ã³ã°ææ³ã使ããªãããããï¼
2011-06-10 22:11:36 via web
ã»ãã¨ã ãã¨ã©ã¼: ã¡ã¤ã³ã»ã¡ã½ãããã¯ã©ã¹Mainã§è¦ã¤ããã¾ããã次ã®ããã«ã¡ã¤ã³ã»ã¡ã½ãããå®ç¾©ãã¦ãã ããã public static void main(String[] args)ã
ã¤ã¶ããã¦æºè¶³ãã¦ããã¿ã¼ã³ã§ãããããããâ¦ã