Professional Documents
Culture Documents
Different Ways of Object Creation: Implementation
Different Ways of Object Creation: Implementation
Inner classes :
The class which declare inside the body of another class is called inner
class. These classes can have access modifier.
Association:
Relation between two separate classes which establishes through
their Objects. It can be one-to-one, many-to-many relation etc
Implementation:
Composition:
Composition is a (strong) Has-a relationship in java. It is the
design technique to implement has-a relationship in classes .
Implementation:
Aggregation:
It is a one way relationship between two object
In Java, aggregation represents (weak) HAS-A relationship.
Implementation:
- Singleton Pattern
- Builder Pattern
- Prototype pattern: