Basic HTML version of Foils prepared 18 May 97

Foil 62 Abstract Methods and Classes

From Java Tutorial - Spring 1997 Part II: Java Language and Object-Oriented Concepts Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


An abstract method has no body - it is provided in a class to define the signature of the method for program structuring purposes. It must be defined in some subclass of the class in which it is declared.
  • Constructors, static methods, private methods cannot be abstract
  • A method that overrides a superclass method cannot be abstract
Classes that contain abstract methods and classes that inherit abstract methods without overriding them are considered abstract classes
  • It is compile-time error to instantiate an abstract class or attempt to call an abstract method directly.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Jan 8 1998