私はシングルトンクラスを持っています
public class Singleton {
static Singleton instance;
public static Singleton getInstance()
{
if (instance == null)
{
instance = new Singleton();
}
return instance;
}
public関数method()がクラスSingleton内で定義されているとします。
シングルトン クラス内でメソッドを呼び出す最良の方法は次のとおりです。
シングルトン。method() - 静的に呼び出すメソッド
また
Singleton.getInstance.method() - メソッドが静的ではない?