Results 1 to 3 of 3

Thread: Inheriitance and Aggregation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Junior Member
    Join Date
    May 2008
    Answers
    1

    Inheriitance and Aggregation

    What is the difference btn inheritance and aggregation when do u use one another?


  2. #2
    Contributing Member
    Join Date
    Sep 2006
    Answers
    42

    Re: Inheriitance and Aggregation

    Inheritance is used for an IS-A relationship.
    Aggregation is used for a HAS-A relationship.

    EG:
    Cars, Scooters are vehicles. (Inheritance)

    Car has a steering, wheel etc. (Aggregation)

    In Inheritance, a class inherits the properties of the base class.
    In Aggregation, a class uses the properties of some other class.


    Regards,
    Sahil.


  3. #3
    Junior Member
    Join Date
    May 2008
    Answers
    2

    Re: Inheriitance and Aggregation

    Inheritance is the process where one object acquires the feature of another
    object. It depicts is-a relationship. Like car is-a vehicle.

    Aggregation deals with Has-a relationship. For example car has engine..
    here engine is an object which is a part of another object called car.

    Regards,
    Krishna.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact