abstract (only method signature, no body).
Player may be an interface and any class implementing Player must be able to (or must implement) move().
So it specifies a set of methods that the class has to implement.
abstract.
Comparator interface, which imposes a total ordering on some collection of objects.
If a class implements this interface, then it can be used to sort a collection.
| The syntax for declaring an interface is given on the right: |
|
interface keyword.
It is used to provide total abstraction.
That means all the methods in interface are declared with empty body and are public and all fields are public, static, and final by default.
A class that implements interface must implement all the methods declared in the interface.
To implement interface use implements keyword.
|
A mother asks her young sons what they want for breakfast. The first little boy says, “I’ll have some @#$%^& pancakes.” The mother angrily sends him to his room for cursing. She glares at the other little boy and asks, “What do you want for breakfast?!” The second boy says, “Well, I sure don’t want the @#$%^& pancakes!” |