There is code like this (in this case non — working):
public class SingletonClass { public SingletonClass() throws Throwable { /* ... */ } public static SingletonClass getInstance() throws Throwable { return SingletonHolder.instance; } private static class SingletonHolder { public static SingletonClass instance = new SingletonClass(); } }
Ie I need to pass an exception constructor in getInstance(), but because it is initialized statically (tried including and using static { }), I don't ask throws.
I hope it is clear explained :)