Maybe is a silly question but not for me.
We have a class: Person
And several subclasses: Student, Teacher, ServicePerson
Person has its properties and methods that are inherit by subclasses.
For example Person.fullName()
Each subclass has its properties and methods.
For example:
Student.register()
Teacher.teach()
ServicePersonal.clean()
We have an array with all Persons and want to know witch students are already registered:
For each p as Person in Persons
if p isa Student then
dim s as string = p.FullName
if p.register then // don't work because p is a Person
// How do I convert p to a Student? To access the Student methods?
end if
end if
Next