I saw in Java that you can create a generic class and a generic method. I also saw the codes that the constructor makes with the class. Is it possible to create only a constructor? And if so, how to call the constructor?
Yes, you can.
class Example { public <T> Example(T t) {} public static void main(String[] args){ // In this example the type can be inferred, so new Example("foo") // works, but here is the syntax just to show you the general case. Example example = new<String>Example("foo"); } }