public class SingletonDemo {
public static void main(String[] args) throws Exception {
Singleton service = Singleton.getInstance();
service.doSomething();
}
}
when I create singleton object then obtain error Singleton can not be resolved to a type.
This is how you could write it