I have been learning about interfaces, and I'm not entirely sure when to use it. So I'm going to make up a scenario and tell me it it is a good way of using it.
Say I'm making a game, that have different characters (I was going to say classes but that would be confusing lol). I have a bunch of classes, that all extend a general hero class, which have methods like setHealth, setAttack, getHealth, getAttack, etc. but they all have a special move, but they all vary, so I could just implement an interface that has a method called specialMove, so that that the game could call on the specialMove when a button is pressed.
would this be a good example of when to use interfaces?