Error Instantiating an Inner Class in Parent's Constructor...
Posted
by stormin986
on Stack Overflow
See other posts from Stack Overflow
or by stormin986
Published on 2010-04-30T19:34:58Z
Indexed on
2010/04/30
19:37 UTC
Read the original article
Hit count: 237
In my application's main class (subclass of Application), I have a public inner class that simply contains 3 public string objects. In the parent class I declare an object of that inner class.
public class MainApplication extends Application {
public class Data {
public String x;
public String y;
public String z;
}
private Data data;
MainApplication() {
data = new Data()
data.x = "String";
}
}
After I instantiate the object in the constructor, I get a runtime error when I try to assign any of the inner class object's variables.
Any idea what's up here??
© Stack Overflow or respective owner