HELP! * GREY=local LOCAL HTML version of Foils prepared July 10 1996

Foil 83 Java Language -- Interfaces - Overview

From Basic Lectures on Java Language Applets Graphics Networking Trip to China and Icase Tutorial -- July 12-28 and June 10-13 96. by Geoffrey C. Fox * See also color IMAGE

An interfaces specifies a collection of methods without implementing their bodies.
  • public interface Storable {
    • public void store(Stream s);
    • public void retrieve(Stream s);
  • }
Interfaces are used to indicate that a class has a certain behavior (has certain methods) without conveying anything else about the class.
Interfaces solve some of the same problems as multiple inheritance, without as much overhead at runtime.
  • There is a small performance penalty because interfaces involve dynamic method binding.
Interfaces can be implemented by classes on unrelated inferitance trees, making it unnecessary to add methods to common superclass.



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 Tue Feb 18 1997