Any type of data can be used as a member variable of type,
the interface can also be used as a member variable of the type of
new Hero class
interfaces Skill defined skills. Then use a method which defines the
generated code
after the definition of a hero class, set over the name, also set skills. But this skill is an interface
There are several ways to create an implementation class here, which way to override the
set of skills, new skills to achieve class
hero class method of increasing attacks
calling the attack method
modified cast
In the form of an anonymous inner class
At the same time the use of anonymous inner classes and anonymous objects