Creating an instance of a subclass extending an abstract class (Java)

Posted by dacay on Stack Overflow See other posts from Stack Overflow or by dacay
Published on 2010-06-08T21:35:21Z Indexed on 2010/06/08 21:52 UTC
Read the original article Hit count: 174

Filed under:
|

In Java, is there any way to create an instance of any class that extends abstract class A, inside a member method of class A? Classes that extends abstract class A will return their instances with this method, but i don't want to implement same method in all subclasses with a "return this();" kind line.

© Stack Overflow or respective owner

Related posts about java

Related posts about oop