Hi !! I know that I can have code like this to see multiple inherience in JAVA
I just want to know, what we are inheriting here...I know tthat interfaces ar very helpful in abstraction, but how does it buy multiple inheritence, what it does, we can't get without it..
"Ignorance is bliss"
Joined: Aug 04, 2004
If you will inherit new classes from MyClass.
SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Joined: May 25, 2004
The biggest reason as far as i can understand is a clear seperation of Two Features in two Interfaces.Now one of these interfaces may specify a protoype for soma utiity class then in that case you have yourfirst interface that you have to implement according to the need and the other for serving a generic utility. the other reason is if you put every code in side one single class you lessen the chances of code reuse.
---------------------------------<br />S.C.J.P 1.4(86%),S.C.W.C.D 1.4(88%)<br /> <br />God Must love crazy people...<br />He Makes so many of them.
Joined: Sep 16, 2003
So, David.. The subclasses of the MyClass will inherit the he two methods defined by the interfaces. That is fine.
But then again, I can inherit it even if I don't define the interfaces at all, and just make the two methods implemented in MyClass. I understand having interface makes the methods more manageable, separate....but is there any thing in terms of inheritence which can't be done without interfaces...