mercredi 27 juillet 2016

How do you declare a variable with the type being a generic class that you DONT have access to without reflection?

Example of what I want:

Seperate jar file:

class poop<T extends Someotherclass>{

}

Another Jar File(main one):

class pee{

    //i want the type of the variable to be poop<?>, but using reflection.
    poop<?> a = reflectionStuff;
}

I have searched, and the closest I got was this method

Field.getGenericType()

I supposed you could cast a variable to a another Class variable? Im not sure





Aucun commentaire:

Enregistrer un commentaire