Thank you all for reading, i'm trying to understand Generics, and i got this excersice where i create a singleton with a generic parameter.
public class Singleton<T> { public static T getInstance() { if (instance == null) instance = new Singleton<T>(); return instance; } private static T instance = null; } But i got this error: Cannot make a static reference to the non-static type T
What can i use as a workaround? Or better yet, what causes the error?