?? elvis.java
字號:
// Serialzable Singleton - Page 11
import java.io.*;
public class Elvis {
public static final Elvis INSTANCE = new Elvis();
private Elvis() {
// ...
}
// ... // Remainder omitted
// readResolve method to preserve singleton property
private Object readResolve() throws ObjectStreamException {
/*
* Return the one true Elvis and let the garbage collector
* take care of the Elvis impersonator.
*/
return INSTANCE;
}
public static void main(String[] args) {
System.out.println(Elvis.INSTANCE);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -