mercredi 7 septembre 2016

How to access variables from private static inner class

I've a class structure like this:

public class Outer{
    private Outer.Inner personal;
    public Outer(){
        //processing.
        //personal assigned value
    }
    ........
    private static class Inner {
        private final Set<String> innerPersonal;
        Inner(){
             innerPersonal=new HashSet<>();
             //populate innerPersonal
        }
    }
}

I get an object of Outer in my program, How can I extract innerPersonal in my program, using reflection.





Aucun commentaire:

Enregistrer un commentaire