can i use inheritance with array, where the array is stored in the Superclass (first level), then subclass for the methods?
Where can i find some examples for this?
john guthrie
Ranch Hand
Joined: Aug 05, 2002
Posts: 124
posted
0
do you mean this (which you can do):
or this (which you cannot):
Layne Lund
Ranch Hand
Joined: Dec 06, 2001
Posts: 3061
posted
0
Can you describe the problem you are trying to solve with this approach? Also give some more detail about what you are trying to do. I'm not quite sure what you are asking about.
Also, have you tried to write code and compile it? In the end, the compiler is the ultimate arbiter that decides what you can and cannot do in the language.
I have no idea how to do and not sure whether you can use array in inheritance.
What i wanted to do is Eg. 5 Radio cars each one of them can only have 2 action either "F" "B" "L" & "R". I needed to use inheritance to save on the coding which it possiblely could, but not sure how to use array with it, so it store their action in the superclass, then execute the method in their subclasses [ November 23, 2004: Message edited by: Cougar Vissert ]