Search:

Type: Posts; User: EDale

Search: Search took 0.08 seconds.

  1. Re: Polymorphorism with array objects of different classes?

    Right I knew that but my question is say if I have an array of people of length 3. I want to call the print() method for each position of the array, but each position is from a different sub class,...
  2. Re: Polymorphorism with array objects of different classes?

    print() is defined in Person and all three subclasses. So when I am going through this loop, the object may be from subclass Oldie, and the next may be from subclass CollegeKid. So if I need to call...
  3. Re: Polymorphorism with array objects of different classes?

    All it says is that it cannot find the symbol method print() so no it doesnt execute.

    My only problem with exercises like this is that I don't know how to call a method of a specific subclass. I...
  4. Polymorphorism with array objects of different classes?

    Hey guys, I'm stuck on this problem and I'm getting absolutely nowhere with it.

    Our Person class has several subclasses, namely CollegeKid and Oldie. Suppose there is yet another subclass:...
Results 1 to 4 of 4