Search:

Type: Posts; User: Norm

Search: Search took 0.09 seconds.

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

    Sounds simple enough to test. Write some small classes with methods, compile and execute it and see what happens.
  2. Re: Polymorphorism with array objects of different classes?

    If a sub class overrides the base class's method, you'll be calling the sub class's method.

    If you have a reference to a class and use it to call a method, you will be calling a method in that...
  3. Re: Polymorphorism with array objects of different classes?

    You need to have a reference to an instance of the class with the method you want to call

    refToClassWithMethod.theMethodToCall(<ARGS GO HERE>);



    System.out.println("Age: " + age);
    Here the...
  4. Re: Polymorphorism with array objects of different classes?

    Does the code compile and execute? If you are getting errors, copy the full text and paste it here.

    Do you have any specific questions about the problem?
Results 1 to 4 of 4