View Single Post
Old 10-30-2012, 04:53 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Its a contract. Objects declared as an interface guarantee that they will contain the methods contracted by that interface. Since Java does not support multiple extends, interfaces are used to perform multiple inheritance, and because of the lack of multiple extends, interfacing is far more valuable in Java than extends ever will be.
So yes, short version would be that interfaces are used for multiple inheritance as it allows you to interpret a single class as multiple datatypes.
Fou-Lu is offline   Reply With Quote