View RSS Feed

Java Object

Object-oriented programming in Java.

  1. IS-A Relationship

    by , 04-26-2012 at 05:31 PM
    IS-A means this object is that object’s type. Now see, how inheritance is achieved by extends keyword
    Java Code:
    public class Animal{
    }
    
    public class Mammal extends Animal{
    }
    
    public class Reptile extends Animal{
    }
    
    public class Dog extends Mammal{
    }
    Following are true for the Object Oriented terms, based at above example:
    • Mammal class’s superclass is animal.
    • Reptile class’s superclass is
    ...
    Categories
    Inheritence