Aggregation vs Composition

Aggregation and Composition are very closely related terms where a novice gets confused and some examples are of good debate too. Observe the code. class Test { public void display() { System.out.println(“Hello 1”); } } class Demo { public static void main(String args[]) { Test t1 = new Test(); t1.display(); } } We say, class …

Aggregation vs Composition Read More »