• Post Reply Bookmark Topic Watch Topic
  • New Topic

Abstract Class Instance  RSS feed

 
Dean Jones
Greenhorn
Posts: 24
  • 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
  • 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
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!