I think I'm facing a conceptual inheritance wall with my Java arrays. I'm a little new to Java, so please tell me if I have something upside down. In essence, I want to do three things:
- Create a runnersArray with the attributes of my Runners class.
- Populate my runnersArray using my GenerateObjects method of my GenerateObjects class.
- Access the contents of my filled runnersArray in my evaluation method of my evaluation class.
The problem is that runnersArray is not displayed for the methods described in steps 2 and 3 above, but their classes (due to design reasons) cannot inherit or extend the Runners class.
Thanks in advance for any suggestions.
Here are some code snippets showing what I'm trying to do:
public class Runners extends Party {
Runners[] runnersArray = new Runners[5];
}
and
public class GenerateObject extends /* certain parent class */ {
public GenerateObject (int arrayNum) {
runnersArray[arrayNum] = ;
}
}
and
public class Evaluating extends {
public Evaluating (int arrayNum) {
System.out.println(;
}
}