So I have some code for a project with four classes, all of which are extended by a super class. The super class is building, the sub classes are church, hospital, library and school. I want to check if the login details for the church etc are correct and to return that specific user. However, without having four seperate methods. Is there a way to return a generic building and cast it into the sepcific building??