若僅是宣告並不會載入class,以下用一段程式碼來測試: TestClass.java. public class TestClass { static { System.out.println("類別被載入"); }
確定! 回上一頁