I am using the Bukkit API to create Minecraft plugins. The Player interface can be called and used like so:
Player p = [insert player here];
String name = p.getName();
However, as Player is an interface, which only has the method and not the method body, how can an interface know what method to do when you do the p.getName() method? The interface has that method in it, but defines no code to execute? As I understand it, you have to define your interface in classes, but since you can have multiple classes implementing the same thing, how does making a call to the interface like that return the name? What am I missing?
Thank you for your time.