File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URGENT - Empty method and abstract method.

 
Anu
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • 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 !!!
 
sandy gupta
Ranch Hand
Posts: 228
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Sunny Liu
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • 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 agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic