| 1600 PMP mock questions | 1400 CAPM mock questions | 800 SCJP 6 mock questions | 600 OCAJP 7 mock questions | 590 OCPJP 7 mock questions | 556 SCWCD 5 mock questions | 500 OCEJWCD 6 mock questions | pdfDownload (java,struts, hibernet etc) | JobsJobs and Walkins |
OOPs and Design Pattern interview questions
|
!!! OOPs and Design Pattern interview questions !!!Example Java Code For Association & Aggregation & CompositionAssociation : This is just relation Both Car and Driver separate entity. class Car { Engine engine; Stereo stereo; } class Driver { } class CarDriverLink { Car car; Driver driver; } Aggregation : If Car object destroy the Engine can survive. class Car { List <Engine > engines; } class Engine { } Composition : If Car object destroy the Engine also.Engine Can't survive. class Car { Engine engine; Stereo stereo; public Car(){ this.engine=new Engine(); } } class Engine { } |
Suggested JobsMore Jobs >> |