This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Create a object of the given generic class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Create a object of the given generic class" Watch "Create a object of the given generic class" New topic
Author

Create a object of the given generic class

Michael Krimgen
Ranch Hand

Joined: Jul 08, 2012
Posts: 35
Hello Ranchers,

If you try to create the following generic class, the compiler will give a warning as the class Stupid is final.
It is obviously impossible to create a (parametrized) object of Generic as the type parameter can only be Stupid,
but the class itself does not implement the interface Runnable.



For the following class, the compiler does not give any warning, so I assume it might be possible to create an object of the class, using
type parametrization.



However, I did not yet succeed to find a way to create an object of the class. Any ideas?

Sorry for the naming of the inner class :-)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44531
    
  34
Why have you got an inner class in the first place?
Michael Krimgen
Ranch Hand

Joined: Jul 08, 2012
Posts: 35
it's not really about the "why", but more about if possible or not :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create a object of the given generic class
 
It's not a secret anymore!