Winston Gutkowski wrote:
Yuvaraj Deena wrote:Im beginner in java programming, i just wanted to know main difference between abstract class and interface in java. However it seems both are similar.
In an abstract class, you can implement (ie, put code in) some or all of its methods if you want. With interfaces, you can't.
Winston
When Java 8 comes out, you can make default implementations for methods in interfaces as well.
There is another significant difference between interfaces and abstract classes. And that is multiple inheritance:
A class can only extend ONE other class (includes abstract classes)
A class can implement an unlimited number of interfaces
An interface can extend an unlimited number of other interfaces