mardi 16 mai 2017

Retrieve class in which variable was instantiated

Is it possible in Java to receive a class, where particular variable was declared? For example, note this code:

class SomeClass {
    private AnotherClass myVariable;
}

What I want to do is to receive a class SomeClass inside the AnotherClass. But I could not find any information about this. If it is not possible, please, inform me.





Aucun commentaire:

Enregistrer un commentaire