Skip to content
javabypankaj
HomeLibraryPopularCommunity
02
OOPs
9 topics · 32 questions
1OOPs Fundamentals0/442Encapsulation & Cohesion0/223Abstraction & Interfaces0/444Inheritance0/335Polymorphism0/776Object Class & Constructors0/557Relationships: Association, Aggregation, Composition0/38Coupling & Design0/229Modern Java OOP: Records & Sealed0/22
1OOPs Fundamentals42Encapsulation & Cohesion23Abstraction & Interfaces44Inheritance35Polymorphism76Object Class & Constructors57Relationships: Association, Aggregation, Composition38Coupling & Design29Modern Java OOP: Records & Sealed2
9 topics32 Qs0%
01Core Java17002OOP3203Collections6704Exception Handling2805Concurrency & Multithreading12706Java Streams, Lambda & Functional Programming32807Spring & Spring Boot2608Transactions3209JPA & Hibernate6910Microservices19411Kafka & Messaging9112DevOps, CI/CD & Tooling13313Database & SQL14114REST API & Web4015Design Patterns & LLD5716Advanced Java7117Coding Problems: DSA49218AWS & Cloud4119Data Engineering19420QA, Testing & SDET4121System Design3522Security2023Behavioral / HR: STAR Method37
9Topics
32Questions
0%Complete
7 of 9 topics
Topics
1OOPs Fundamentals0/442Encapsulation & Cohesion0/223Abstraction & Interfaces0/444Inheritance0/335Polymorphism0/776Object Class & Constructors0/55
7Relationships: Association, Aggregation, Composition0/33
8Coupling & Design0/229Modern Java OOP: Records & Sealed0/22

Relationships: Association, Aggregation, Composition

OOPs·Topic 7 of 9·3 questions
Q1What is aggregation vs composition?

Aggregation means the child survives the parent's destruction (independent lifecycle). Composition means the child dies with the parent (bound lifecycle). JPA: aggregation has no cascade; composition uses cascade ALL with orphanRemoval.

Read Answer
Q2What is association vs aggregation vs composition?

Association means uses (arrow in UML). Aggregation means has with part surviving (hollow diamond). Composition means owns with lifecycle tied (filled diamond). Weakest to strongest: association, aggregation, composition.

Read Answer
Q3What is the delegation pattern?

Delegation holds a delegate and forwards selected calls. Inheritance inherits all parent methods. Delegation gives control (expose what you want), flexibility (swap delegate), and safety (add logic around calls).

Read Answer
Previous · Topic 6Object Class & Constructors5 questionsNext · Topic 8Coupling & Design2 questions
javabypankaj© 2026 javabypankaj
PrivacyTerms
HomeSearchLibrary