wood burning stoves 2.0*
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
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: 38363
    
  23
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