Last active
December 8, 2020 04:53
-
-
Save ucguy4u/e779e622dee423e4001dd61bbaa98e60 to your computer and use it in GitHub Desktop.
eg: Association in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//eg: Association in Java | |
class A { | |
int x = 10; | |
} | |
class B { | |
A a = new A(); | |
// new A()--> This is composition; part in java which is necessary. | |
// A a --> This is aggregation; part in java which is not necessary. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment