Kyle Hamilton
asked on
modify variable of parent class
public class Parent{
String regExpr;
String target;
public static ArrayList<Character> language;
public Regex(String regExpr, String target){
this.regExpr = regExpr;
this.target = target;
this.language = language;
}
private class Child{
void buildLanguage(char c){
language.add(c);
}
}
}
I would like to modify the language variable of the parent class, but I'm getting a java.lang.NullPointerExcep
Can this be done?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ended up redesigning the classes, so that the "Child" class is now it's own class, with a public method that returns the language variable. this means my "Child" class is potentially re-usable in other projects.
cheers.