• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Abstract Class

 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If a class has abstract method/s it must be declared abstract. The implementation of the method may be provided in the subclass. Ok!!! But is it that I MUST AND MUST have the subclass. I know it isnt wise but what if I dont extend a thing from it? :-/
 
Saravanan Thirugnanam
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its No problem if u dont have a subclass for a abstract class. But if you extend from a abstract class, the subclass must either give the implementation for all the abstract methods of the parent class or else ,the subclass should also be declared as abstract.
Inform me if i misunderstood your question..
 
Naveen Punati
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai...

its not possible to create instance for an abstract class ...so definitely u will extend it ..otherwise no use of declaring abstract class...

if u extend from an abstract class definitely u should inplement all the abstract classes otherwise deine child class as abstract...

i think this will clarify ur doubt....

truly,
Naveen.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic