Call a method of subclass in Java

If you know that thing contains a Subclass, you can do:

((Subclass) thing).specialMethod()

Leave a Comment