Advantage of Abstract Classes

holiday card

Abstract classes are a way of organizing a program. You can get the same thing done without using this way to organize. This is a matter of program design, which is not easy at all.

Here is a sample run of the program:

Dear Santa,

Season's Greetings!

The advantage of using an abstract class is that you can group several related classes together as siblings. Grouping classes together is important in keeping a program organized and understandable. The picture shows this program after its object has been constructed.

It would be nice to deal some other cards. Here is a skeleton for the Birthday class:

class Birthday extends  
  int age;

  public   ( String r, int years )
    recipient = r;
    age = years;

  public void greeting()
    System.out.println("Dear " + recipient + ",/n");
    System.out.println("Happy " +   + "th Birthday/n/n");


Fill in the missing parts.