wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes HAS-A relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "HAS-A relationship" Watch "HAS-A relationship" New topic
Author

HAS-A relationship

Andy James
Ranch Hand

Joined: Aug 22, 2005
Posts: 90
Hi all,

Can classes and interfaces share HAS-A relationship? For the following code, is it correct to say that MyClass HAS-A MyInterface and MyInterface HAS-A MyClass?



cheers
A
Ankit Gareta
Ranch Hand

Joined: Mar 28, 2011
Posts: 67

Hi James,

I think , classes and interfaces share HAS-A relationship .
so that your mentioned scenario is perfectly true.

please, correct me if I am wrong somewhere.

Thanks,
Ankit


OCPJP 6 (91%)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HAS-A relationship
 
Similar Threads
Anonymous class behavior confusion !
Overriding rules... Please confirm!
Enthuware: relationship is-like-a
Difference between object and instance
Inheritance question - Interfaces