Ask Question
18 January, 19:31

Write the printitem () method for the base class. sample output for below program: last name: smith first and last name: bill jones

+5
Answers (1)
  1. 18 January, 19:44
    0
    The question involves basic polymorphism. The following is the partial flow of the program.

    baseItemPtr = new BaseItem ();

    baseItemPtr. setLastName ("Smith");

    derivedItemPtr = new DerivedItem ();

    derivedItemPtr. setLastName ("Jones");

    derivedItemPtr. setFirstName ("Bill");

    itemList. add (baseItemPtr);

    itemList. add (derivedItemPtr);

    for (i = 0; i < itemList. size (); + + i) {

    itemList. get (i). printItem ();

    }

    return;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write the printitem () method for the base class. sample output for below program: last name: smith first and last name: bill jones ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers