Abstract Superclass

There is no object of Abstract class because it is abstract. For example, the class of Animal can be a abstract superclass, which means there is at least one abstract method (function) in the Animal class.

abstract class Animal{
private int itsAge;
public int getAge() {
return itsAge;
}
public abstract void move(); //abstract function
}

Because Animal is abstract class, you cannot do this:

Animal a = new Animal (); //Animal is abstract; cannot be instantiated
In the other word, object can only exist when the class is conrete class. You can derived the Cat class from Animal Class, and implement the move method, then you can do this:

Animal a = new Cat (); //object of Cat is also the object of Animal;

7 Responses to “Abstract Superclass”

  1. Boy George Says:

    Oh wait. Yes, I have. I’m sorry, but I just don’t have it in me right now to type it all out again. Besides, it was just ramblings anyway. You didn’t want to hear me go on and on about this, right?

  2. Dana Says:

    Thank you !!! I was having a problem regarding this topic πŸ™‚

  3. Nasir Mehmood Says:

    Thanx! But still give some more detail.

  4. Curtsy Says:

    Somehow i missed the point. Probably lost in translation πŸ™‚ Anyway … nice blog to visit.

    cheers, Curtsy.

  5. ads Says:

    succinct but some addition shall be even greater. like cat class πŸ™‚

  6. Johna992 Says:

    Enjoyed studying this, very good stuff, regards . A man may learn wisdom even from a foe. by Aristophanes. kekcedddcbee

  7. Jerrell Says:

    Expenses range between 5,000 to 60,000.

Leave a comment