• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

URGENT - Empty method and abstract method.

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between abstract methos and a method without any body i.e. only empty braces are given for methos but no body is there.
Why cant we use empty method in the place of abstract method ?
Pls explain the usage/advantages/disadvantages of both....Its urgent !!!
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you do not have to provide the definition of a base class method but an abstract base class method needs to have a definition in the derived class
Got it
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not call a abstract method, but you can call empty method. class with a abstract method, then it have to be a abstract class, sequencely you can instantiate a abstract class as well.
Usually you provide empty method just because you want to use some other methods from parent class or implements a interface but you do not want to implements all of methods defined in interface definition.
 
I am going down to the lab. Do NOT let anyone in. Not even this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic