?? inittest18.java
字號:
// initialization/InitTest18.java
// TIJ4 Chapter Initialization, Exercise 18, page 198
/* Attach objects to the references in array in exercise 17: Create a class with
* a constructor that takes a String argument. During constriction, print the
* argument. Create and array of object references to this class, but don't
* actually create objects to assign into the array. When you run the program,
* notice whether the initialization messages from the constructor are printed.
*/
class InitTest {
InitTest(String s) {
System.out.println("InitTest()");
System.out.println(s);
}
}
public class InitTest18 {
public static void main(String[] args) {
InitTest[] it = new InitTest[5];
for(int i = 0; i < it.length; i++)
it[i] = new InitTest(Integer.toString(i));
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -