• August 24, 2014
  • Core Java
  • Comments Off on Association in java

Association in java

Association is a way of defining a relationship between classes of objects. Two classes are said to be associate with each other if they are related with each other in some way.

Types of Association:  

association types

 

Important definitions for association:

Subclass/child class/ derived class:

          A class which is derived from another class.

Super class/ parent class/ Base class: 

           A class from which subclass is derived.

Example:

Let us take the example of Student and MCAStudent. A MCAStudent is derived from Student class and can inherit the properties from Student class. So MCAStudent is a subclass and Student is a super class here.

Note: Every class in java except object class have a super class (object class is a super class of all classes).

 
Next Topic: Inheritance in java with examples.
Previous Topic: Dynamic method dispatch or Runtime polymorphism in java with example.

Related Topics:

Method overloading in java with example.
Method overriding in java with example.
Dynamic method dispatch or Runtime polymorphism in java with example.
Association in java with example.
Inheritance in java with examples.
Aggregation in java with example.

 


Comments are closed.