Association(HAS-A) Aggregation And Composition in Java [MOST COMMONLY ASKED INTERVIEW QUESTION]

preview_player
Показать описание
In this video of code decode we have discussed about Association Aggregation and Composition in Java in detail

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :

Association
Association refers to the relationship between multiple objects. It refers to how objects are related to each other and how they are using each other's functionality. Composition and aggregation are two types of association.

Composition
The composition is the strong type of association. An association is said to composition if an Object owns another object and another object cannot exist without the owner object. Consider the case of Human having a heart. Here Human object contains the heart and heart cannot exist without Human.

Aggregation
Aggregation is a weak association. An association is said to be aggregation if both Objects can exist independently. For example, a Team object and a Player object. The team contains multiple players but a player can exist without a team.

aggregation in java,association in java,is a relationship in java,is a and has a relationship in java,java association,java association aggregation composition,java is a relationship,java has a relationship,association aggregation and composition in java,aggregation and composition in java

#Association #Aggregation #Composition
Рекомендации по теме
Комментарии
Автор

I had a hard time understanding this before watching this video.
Now I understand. Thank you!!

Landon_Hughes
Автор

Example wise, if composition is there, you can declare part-of variable like engine as private final so that it has to be initialize to exist the car or initialize Car instance.

kids-plays
Автор

sorry to be pedantic . The Code shown is just wrong.
In aggregation, the parent class is not responsible for its creation and will have its own life cycle . The code shown here for aggregation exhibits composition.
for Aggregation if its unclear how to do it,
The other objects are injected during construction and its also rightly called as dependency injection and only by that design aggregation can be acheived.

wishadw
Автор

Pretty Straight forward and catchy explanation:) Thank you

amulyal
Автор

Hello thanks for the video, looking at the code only, how can you differentiate between aggregation and composition?

stephanesonkeng
Автор

Once again, very nice video, but I have one question.
If there is part of relation between car and engine, so engine is tightly coupled with car. Does it mean engine's life cycle is completely depending on car? If engine's life cycle is depends on car, then there should not be getter method for engine, because if we provide getter method for engine then engine will be available outside class car also, then how can engine's life cycle depends on class Car. Please clear my doubt.

chetankhandave
Автор

Simple and Best
I expect more from you about Core Java not only that do the videos on microservices, webservices also

seenuiglesias
Автор

Simple and to the point, thanks for the explanation.

charan_
Автор

Really practical and crystal clear explanation

prateeksahu
Автор

An association is known as Aggregation when one object uses another object. Is it Correct?

sudiptanandi
Автор

I followed most of your videos, but somehow missed this one, and this was exactly asked today for me in Oracle, couldn't answer it properly 😢

shravanthsrinivas
Автор

thanks alot mam for revising these concepts

saundaryasrivastava
Автор

Comparable and comparator Tutorial please...with live example

navneettripathi
Автор

mam pls explain with programetically, bcz interviewer need this. thank you

RAMCHARAN-byoq
Автор

I've understood the topic even in spite of your Hindu english, great explanation

dimashtef
Автор

Mam composition ka ek example run karake dikha dijiye

sohilusmani
Автор

baki sab tu thek hn mam pr ap ro q rhi hu ..

codewithnain
Автор

Association(HAS-A) Aggregation And Composition in Java madam pls give me code link

pavankumar-vgev
Автор

but this concept mostly use in android programing

gamesfun
Автор

the relationsihip between me and my car is composition !!!!

jaserq