Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

instantiation

 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can't we instatiate the abstract class or not...
some where i read that we can do but when i tried it its not working
can somebody help me
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can never instantiate an abstract class.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot directly instantiate an abstract class. However, you can instantiate a concrete subclass and upcast the reference to the abstract type. For example...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic