In your specific cases there is no difference. And your second is already effective final .
But
Leaving aside the fact that the implementation below is not thread safe, simply showing the difference with respect to the final.
In case of lazy initialization of your instance, you can feel the difference. Look at lazy initialization.
public class Singleton {
private static Singleton INSTANCE; /error
private Singleton() {
}
public static Singleton getInstance() {
if (INSTANCE ==null) {
INSTANCE = new Singleton();
}
return INSTANCE;
}
}
source
share