I know this is probably pretty basic, and I’m ashamed for not knowing how to do this (and worse yet, being unsuccessful in searching for a solution).
How would I pass an object of type thing from A to C?
public class A extends B {
}
public class B {
public class thing {
}
}
public class C extends JFrame {
}
I have access to thing in A because I’m extending B, but I’m unable to extend B when using class C because I need to extend JFrame.
EDIT
Sorry for the vagueness. Class A has a collection of objects of type thing and I want to iterate through those objects in class C.
EDIT 2
And of course… the obvious choice. Make thing its own class… 🙁
Admitting shame for the sake of those who may also have an issue like this.
First, if it’s an inner class – you probably shouldn’t access it from the outside…
But, if you insist, you can try to do as follows: