You read these stack traces from the top down, paying special attention to the first line that mentions your code because this is where the exception occurred.
Line 34 of DataStructure.java is...
Type: Posts; User: pbrockway2
You read these stack traces from the top down, paying special attention to the first line that mentions your code because this is where the exception occurred.
Line 34 of DataStructure.java is...
Please say what the exception is. It is a good idea to post the entire stack trace because this also says on what line of your code the exception occurred.
-----
Once you have added that line...
What is the code? What was the exception?
(If the code is long remove anything that is not essential to illustrating the problem).
The following accesses and prints the values fine:
...
1) Yes, you can't have two nested Bar classes. But you *can* have two Bar classes one nested, one not in the same package with the compiler doing a little name mangling to keep things straight. It...
I can't see any reason why there shouldn't be multiple classes: the full name of a type includes the packages and enclosing classes.
For instance the following compiles just fine:
...
As with "this" and variables it can be dropped if there is no confusion.
int foo;
void setFoo(int foo) {
this.foo = foo;
}