How do you represent a composition in Java?

In Java, the ‘final’ keyword is used to represent Composition . This is because the ‘Owner’ object expects a part object to be available and function by making it ‘final’. Let us take another example that depicts both inheritance and composition.

Sizin İçin Seçtik  What is the different kind of relationship among classes?

Leave a Reply

Your email address will not be published. Required fields are marked *