So this more than likely has a simple answer, but i cant seem to find it. I have a 2d array in one class, what I want to do is get this array into my other three classes. Now I'm not sure but I believe I have to use inheritance, or paramater passing. If you can just point me in the right direction I'd be grateful.
MistaGeorge
0
Newbie Poster
Recommended Answers
Jump to PostThe answer depends on how the four classes are related. Do any extend any others? Do the other three have a reference to the fist class instance?
Jump to Post@MistaGeorge: that's correct. A parent cannot inherit from subclass.
Having said that, just for the sake of availability of a 2d array you may not need an inheritance structure.
Share your class design or atleast tell us what you're trying to design so that we can guide you better.
@jalpesh_007: …
All 7 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
jalpesh_007
-3
Newbie Poster
MistaGeorge
0
Newbie Poster
NP-complete
42
Junior Poster
MistaGeorge
0
Newbie Poster
MistaGeorge
0
Newbie Poster
NP-complete
42
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.