File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Polymorphism and clildren that won't listen. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Polymorphism and clildren that won Watch "Polymorphism and clildren that won New topic

Polymorphism and clildren that won't listen.

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I have a program that I am exercising polymorphism with but I cannot access the child members.
Any ideas on how I go about getting to these members in my Main()?
here is what I have beware quite lengthy)

edited by Dave to format code

[This message has been edited by Dave Vick (edited October 22, 2001).]
Jason Ford
Ranch Hand

Joined: Aug 02, 2001
Posts: 54
I've taken a couple of pieces from your code that I don't understand and placed them here:

You say you can't access the three lines at the bottom. Do you mean you can't access the REF member variable of myRunner? Where is REF declared as a member variable? I see a REF1 member, but you say you added that when something else didn't work.
Also, what do you mean by "child members?" Again, I don't see any members that are derived from RaceEntryForm.
Try moving the declaration of REF to the top of the class where you declare your other member variables. Also, please let us know why some things aren't working. How do you know you can't access certain variables? Are you receiving an error or exception?

[This message has been edited by Jason Ford (edited October 23, 2001).]

I agree. Here's the link:
subject: Polymorphism and clildren that won't listen.
It's not a secret anymore!