V
Vincent Cantin
Hello,
I have a class Server<C extends Connection> that accepts some connections
are for each of them creates an instance of C.
Problem : the implementation of the class need to have C.class in order to
create its instance but it doesn't know it unless I ask the user of my class
to give it in parameter.
So the user of the class write something like that :
Server server = new Server<MyConnection>(MyConnection.class);
but I would like him to only write something like that :
Server server = new Server<MyConnection>();
Is there something in the language of Java 1.5 that can do implicitly what I
want ?
Thank you,
Vincent
I have a class Server<C extends Connection> that accepts some connections
are for each of them creates an instance of C.
Problem : the implementation of the class need to have C.class in order to
create its instance but it doesn't know it unless I ask the user of my class
to give it in parameter.
So the user of the class write something like that :
Server server = new Server<MyConnection>(MyConnection.class);
but I would like him to only write something like that :
Server server = new Server<MyConnection>();
Is there something in the language of Java 1.5 that can do implicitly what I
want ?
Thank you,
Vincent