Yes of course, that's the whole point of polymorphism.