Difference between revisions of "Aggregation - 2017"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(It's not on the Skeleton Program, but use it for revision.)
 
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Aggregation is where if you delete the main class and all it's subclasses aren't deleted along with it.
+
Aggregation is creating an object containing other objects in a way that they will continue to exist even if the containing object is destroyed.
 +
 
 +
For example, if college decided disband your Computer Science group you would all still exist as students.
 +
 
 +
==Skeleton Program==
 +
No examples of aggregation exist in the skeleton program.
 +
 
 +
If you did want to use aggregation you could declare you objects in the <code>static void main()</code> of your program.

Latest revision as of 10:05, 15 June 2017

Aggregation is creating an object containing other objects in a way that they will continue to exist even if the containing object is destroyed.

For example, if college decided disband your Computer Science group you would all still exist as students.

Skeleton Program

No examples of aggregation exist in the skeleton program.

If you did want to use aggregation you could declare you objects in the static void main() of your program.