public enum Singleton {
INSTANCE;
String fromLocation;
String toLocation;
private void initialise(String fromLocation, String toLocation) {
this.fromLocation = fromLocation;
this.toLocation = toLocation;
}
public static void main(String[] args) {
Singleton s = INSTANCE;
s.initialise(args[0],args[1]);
}
}
メインルーチンからも引数を渡すことができる通常のJavaクラスコンストラクターを持つ構文を理解できないようです。初期化ルーチンは私には悪臭のように思えますが、これは私が思いついた中で最高のものです。助言がありますか?