This content has been marked as final. Show 3 replies
Honestly, this isn't what generics were set out to do. If you need this kind of functionality, you should have a constructor that takes a class object
877736 wrote:Did you look at the answers given there? Pretty much the same as ttjacobs is telling you here: This is NOT what generics was created for.
My issue is similar to this Re: creating instance of generic type post...
Even if you can do it, the code is likely to be messy, complex and brittle.
Also: this thread is in the wrong category, as the other poster (you?) was already told. There is a "Generics" section under Java APIs.
My suggestion: rethink your solution.
Moderator action: Moved from Java Programming.
Moderator advice: Please read the announcement(s) at the top of the forum listings and the FAQ linked from every page. They are there for a purpose. Then edit your post and format the code correctly.