File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes URGENT - Empty method and abstract method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "URGENT - Empty method and abstract method." Watch "URGENT - Empty method and abstract method." New topic

URGENT - Empty method and abstract method.

Ranch Hand

Joined: Oct 31, 2000
Posts: 54
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

Joined: Jan 30, 2001
Posts: 228
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

Joined: Mar 15, 2002
Posts: 63
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.

If I am rich, I will spend more.<p>IBM 486 (OOAD & UML) & 141 (XML) passed<br />Oracle 1Z0-007 passed<br />MCSD MCDBA MCSE <br />SCJP SCSSA<br />CCNA CNA A+
I agree. Here's the link:
subject: URGENT - Empty method and abstract method.
It's not a secret anymore!