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

  Рет қаралды 160,729

Code Decode

Code Decode

Күн бұрын

Пікірлер: 72
@Landon_Hughes
@Landon_Hughes 4 жыл бұрын
I had a hard time understanding this before watching this video. Now I understand. Thank you!!
@CodeDecode
@CodeDecode 4 жыл бұрын
M glad 👍
@thakrenikhil
@thakrenikhil 2 жыл бұрын
@@CodeDecode i agreed with Landon, now its very clear for me as well
@sohilusmani8276
@sohilusmani8276 5 ай бұрын
Mam composition ka ek example run karake dikha dijiye
@kids-plays
@kids-plays 2 жыл бұрын
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.
@wi8shad0w
@wi8shad0w 2 жыл бұрын
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.
@amulyal5561
@amulyal5561 4 жыл бұрын
Pretty Straight forward and catchy explanation:) Thank you
@CodeDecode
@CodeDecode 4 жыл бұрын
Thanks 👍
@charan_75
@charan_75 3 жыл бұрын
Simple and to the point, thanks for the explanation.
@CodeDecode
@CodeDecode 3 жыл бұрын
Thanks Charan 👍🙂
@prateeksahu6332
@prateeksahu6332 3 жыл бұрын
Really practical and crystal clear explanation
@CodeDecode
@CodeDecode 3 жыл бұрын
Thanks .......
@juanestebanparraparra6302
@juanestebanparraparra6302 2 жыл бұрын
Neatly explained!
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks 🙂👍
@stephanesonkeng4569
@stephanesonkeng4569 4 жыл бұрын
Hello thanks for the video, looking at the code only, how can you differentiate between aggregation and composition?
@marcosdiasdev
@marcosdiasdev 3 жыл бұрын
In composition the "parts" objects are created and deleted by their "owner". For example, you can have Order and OrderItem. In Order constructor you can instantiate your OrderItems. If the Order is destroyed then you must have a method for destroying OrderItems too.
@thegeographicalterm5974
@thegeographicalterm5974 2 ай бұрын
Thank you very much this clarify my problems.
@CodeDecode
@CodeDecode Ай бұрын
You are welcome!
@chetankhandave
@chetankhandave Жыл бұрын
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.
@seenuiglesias4035
@seenuiglesias4035 5 жыл бұрын
Simple and Best explanation..... I expect more from you about Core Java not only that do the videos on microservices, webservices also
@CodeDecode
@CodeDecode 5 жыл бұрын
Don't worry I have a plan for J2EE, Spring, Hibernate, JPA, micro services, rest full web services, and even react and machine learning too. But it will take some time as i am a developer in an MNC. I need some time to shoot these videos but i have a plan to do so in near future.
@usamaansari7903
@usamaansari7903 5 жыл бұрын
@@CodeDecode yes mam do that but first clear all core java concepts all small small things to big big things and plzz plzzz also make a playlist of SWING AWT javafx and applets separates plzzz and then only switch to J2EE u r explanation is wonderful and very clear so that's y I am expecting from u tysm☺
@SunilKumar-on1iq
@SunilKumar-on1iq 4 жыл бұрын
👏👏👏👏👏👏
@sudiptanandi2011
@sudiptanandi2011 3 ай бұрын
An association is known as Aggregation when one object uses another object. Is it Correct?
@ironone4438
@ironone4438 3 ай бұрын
Not exactly, because you can have a composite association where an object of a class uses another object from another class
@ZeeshankhanKhan-b1r
@ZeeshankhanKhan-b1r 2 ай бұрын
Watching before one day from exame
@CodeDecode
@CodeDecode 2 ай бұрын
All the very best
@saundaryasrivastava8638
@saundaryasrivastava8638 8 ай бұрын
thanks alot mam for revising these concepts
@CodeDecode
@CodeDecode 8 ай бұрын
🙂🙂
@navneettripathi2110
@navneettripathi2110 5 жыл бұрын
Comparable and comparator Tutorial please...with live example
@usamaansari7903
@usamaansari7903 5 жыл бұрын
@@CodeDecode no mam u go step by step take u r time but make a video step by step after oops concepts u can make arrays videos and them collection
@CodeDecode
@CodeDecode 5 жыл бұрын
Don't worry guys i will cover most of the basics of Java including oops, arrays n comparable and comparator everything in this month only
@dheebanm3207
@dheebanm3207 3 жыл бұрын
Very useful mam,thank you
@CodeDecode
@CodeDecode 3 жыл бұрын
Thanks 👍👍
@shravanthsrinivas8700
@shravanthsrinivas8700 4 ай бұрын
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 😢
@CodeDecode
@CodeDecode 4 ай бұрын
No worries Shravanth few questions unanswered are completely fine in interviews. Target answering 80 percent and that will be enough for clearing the round🙂👍 all the very best mAn. U will do great. Keep learning keep shining 🌟🌟
@shravanthsrinivas8700
@shravanthsrinivas8700 4 ай бұрын
@@CodeDecode thanks a lot ❤️
@RAMCHARAN-by2oq
@RAMCHARAN-by2oq 2 жыл бұрын
mam pls explain with programetically, bcz interviewer need this. thank you
@CodeDecode
@CodeDecode 2 жыл бұрын
Sure Ram 👍👍
@rudraninoothi609
@rudraninoothi609 2 жыл бұрын
Nice explanation mam
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks 🙂🙂🙂
@dimashtef7077
@dimashtef7077 3 жыл бұрын
I've understood the topic even in spite of your Hindu english, great explanation
@CodeDecode
@CodeDecode 3 жыл бұрын
Thanks 😊
@sohilusmani8276
@sohilusmani8276 5 ай бұрын
Mam composition ka ek example run karake dikha dijiye
@rickqin8624
@rickqin8624 4 жыл бұрын
Great work!
@CodeDecode
@CodeDecode 4 жыл бұрын
Thanks 👍
@RAJ-wx7cr
@RAJ-wx7cr 4 жыл бұрын
Awesome explanation mam
@CodeDecode
@CodeDecode 4 жыл бұрын
Thanks:)
@Mewari_Rana
@Mewari_Rana 5 ай бұрын
samaj hi nhi aaya kuch
@srimanjivlogs3803
@srimanjivlogs3803 2 жыл бұрын
worthy ❤️
@CodeDecode
@CodeDecode 2 жыл бұрын
Thanks
@umadevi11112
@umadevi11112 3 жыл бұрын
Thanks alot ❤️
@CodeDecode
@CodeDecode 3 жыл бұрын
You are welcome Uma........
@pankajchandel1000
@pankajchandel1000 3 жыл бұрын
Where is the code?
@rafidhassanrisun5341
@rafidhassanrisun5341 3 жыл бұрын
balle balle
@CodeDecode
@CodeDecode 3 жыл бұрын
🙂👍
@zarintasnimela138
@zarintasnimela138 3 жыл бұрын
Shava shava
@pavankumar-vg8ev
@pavankumar-vg8ev Жыл бұрын
Association(HAS-A) Aggregation And Composition in Java madam pls give me code link
@tanishkavaswani3360
@tanishkavaswani3360 3 жыл бұрын
thankyou :)
@CodeDecode
@CodeDecode 3 жыл бұрын
🙂🙂👍👍
@jaserq
@jaserq 3 жыл бұрын
the relationsihip between me and my car is composition !!!!
@CodeDecode
@CodeDecode 3 жыл бұрын
🤣
@rubbish9231
@rubbish9231 9 ай бұрын
🤨🧐🧐 but here engine can exist without car.
@CodeDecode
@CodeDecode 9 ай бұрын
Yeah engine you can get in market in real world analogy
@Querty43098
@Querty43098 8 ай бұрын
But what if it is not used in any car so it's useless that's why both needed each other to be complete
@dotnetdevyt
@dotnetdevyt 3 ай бұрын
But not useful
@games4fun584
@games4fun584 Жыл бұрын
but this concept mostly use in android programing
@Harlogs
@Harlogs 7 ай бұрын
Areyyy yarrr nothing nothing nothing………Your video is nothing but full of nothing😂
@ZeeshankhanKhan-b1r
@ZeeshankhanKhan-b1r 2 ай бұрын
Watching before one day from exame
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Association, Composition, Aggregation
3:13
Gray Hoodie Software | Kevin Ewig
Рет қаралды 26 М.
Association vs Aggregation vs. Composition
5:46
Siva Reddy
Рет қаралды 72 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.