This article, written somewhat abstract classes and interfaces to understand, but it is a bit confusing for the use of children
if you can blurt out the following three questions, explain your level is very solid, do not read
1, the interface can be inherited interfaces ?
2, abstract class can implement interfaces do?
3, the difference between abstract classes and interfaces?
The first two answers are yes
this article theory less, are exploring the use of the code is that you can not use standard red, red is the standard error
interface
Interface inheritance, no problem
inherited class, an error (as an abstract class)
multiple inheritance interfaces, there is no problem
implementing the interface, error
static method interface must have a body
Summary: The interface can extend even more than extend the interface, but can not extend classes and interfaces implent
Explanation: The interface itself is no method body, so no matter how inheritance interfaces are empty, there is no problem, but the need to implement specific method body, so you can not use
Abstract class
An abstract class can not abstract methods
Abstract class without abstract methods can instantiate
abstract class contains abstract methods need to override all the abstract methods to remove the abstract keyword to instantiate the
subclass of abstract class must override abstract methods, if the child class is abstract, it is not heavy write
An abstract class can be the same as the general category, extend the abstract class, implement interfaces, and calling the main function