• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract Class Instance

 
Dean Jones
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can any one of u tell me
is there any way to have the instance of the abstract class.
i dont think so but i was asked this in an interview so there might be...........
Dean Jones
 
Mohan Panigrahi
Ranch Hand
Posts: 142
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dean,
Ofcourse you cannot instantiate an abstract class. But you can use the implementation of an abstract class by extending it.
Here is the code :
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. There is no way to instantiate an abstract class. You can have an identifier of the abstract class type, of course.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic