go to previous page   go to home page   go to next page

Answer:

Yes.


Example Output

birthday cards

The program will output:

Dear Sophia,
Happy 7th Birthday
How you have grown!!

Dear Walter,
Happy 47th Birthday
You haven't changed at all!

Dear Zoe,
Happy 30th Birthday

The abstract class Card is an ancestor of each of the three classes, so the variable crd can refer to each of them. Now inspect the following:

YouthBirthday birth;
birth = new Birthday( "Terry", 23 );

QUESTION 10:

Is this code correct?


go to previous page   go to home page   go to next page