<<< Aggregation in UML (containment by reference)     Index     Composition in UML (containment by value) >>>

19. Aggregation in Java and C++ compared

  • 
    // Java 
    public class Department
    {
    
        private Employee myEmployee;
    
    }//class Department
    
    
  • 
    // C++
    class Department
    {
    private:
        Employee* myEmployee;
    
    };//class Department
    
    

<<< Aggregation in UML (containment by reference)     Index     Composition in UML (containment by value) >>>