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


Rupinder Bains
Ranch Hand

Joined: Jul 23, 2002
Posts: 65
what is an abstract class and and abstract method?
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
An abstract class is a class that cannot be instantiated. An abstract method is a method that has no implementation.
An abstract class need not have any abstract methods, but a class that has an abstract method must be declared an abstract class. Also, any class that subclasses an abstract class or interface and does not override all the methods must also be declared abstract.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Sample code:
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
You may want to take a look at "Writing Abstract Classes and Methods" from Sun's Java Tutorial and chapter 51 of Bradley Kjell's Introduction to Computer Science using Java.

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
I agree. Here's the link:
subject: ABSTRACT
It's not a secret anymore!