• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

may be a dumb question

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am chintan ramavat,
quick question,

i know the characteristic of abstract class and abstract method but i dont know what's the use of abtract method ? abstract class is totally fine that we use them for polymorphic purpose but, dont know abt abstarct method ?

Thank you ranchers
have a nice day
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An abstract method is used when you want to force a child class to implement a method, and/or there's no sensible default implementation for a polymorphic method. In the classic "Shape" example, whre you have a "Shape" class and subclasses like "Circle" and "Square", you'd make "draw()" an abstract method, since there's no sensible default way to draw a Shape without knowing what kind of shape it is.
 
chintan ramavat
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so if i m not mistaken, super class forces -> sub classes to implement abstarct method not just to override them.
reply
    Bookmark Topic Watch Topic
  • New Topic