Call a method of subclass in Java
Posted
by eyecreate
on Stack Overflow
See other posts from Stack Overflow
or by eyecreate
Published on 2010-04-23T18:50:37Z
Indexed on
2010/04/23
18:53 UTC
Read the original article
Hit count: 267
java
If I have a base class
Base thing = null;
of which there is a subclass
class Subclass extends Base
and I instigate it as
thing = new Subclass
how would I call a method that is specifically in Subclass, but not in Base?
ex.
Base
has only method()
Subclass
has method()
and specialMethod()
the method specialMethod()
is the one I want to call.
© Stack Overflow or respective owner