Seetharaman Venkatasamy wrote:
It is an expected output! constructor calls itself again since you are calling the constructor from instance filed declaration(initialization block)
Matthew Brown wrote:Why do you have a <T> at the front of your constructor? Try deleting that, and I suspect it will work.
What I think is happening here is that the <T> there is being used to define a generic method. This is separate from the T defining the generic class. So you've actually got two different Ts meaning different things, which leads to a conflict. On line 6 you're trying to assign from one to the other.