[5920] in java-interest

home help back first fref pref prev next nref lref last post

Why use interfaces?

daemon@ATHENA.MIT.EDU (dc)
Mon Mar 4 21:52:07 1996

Date: Mon, 4 Mar 1996 17:37:40 -0800
To: java-interest@java.sun.com
From: dc <dc@symbolicsoft.com>

Trying to understand what is the point of interfaces.....

As I understand, an interface just specifies functionality that an object
will implement - but doesn't link in any of that functionality.

So if I define a class 'myRect' that implements 'drawable', I still have to
put all the drawcode in 'myRect' - and if I then make a 'myCircle' the code
gets duplicated - it doesn't substitute for multiple inheritance.

How do interfaces help? I can't see the advantage, apart possibly from
documentation.

If I'm creating an applet, and I declare it as implementing 'runnable' does
that let the compiler know that it wants to be sent 'run' messages? Or do
all applets get the 'runnable' methods called anyway, they just pass
through. Is there any point in using the 'runnable' keyword when defining
your class?

Sure there must be a point, somehow help me not to miss it!!

dc
___________________________________________________________________

      /\    dave 'dc' collier
     /_/\     Symbolic Software, Inc.
    /_\_ \      dc@SymbolicSoft.com
   /___/__\       tel (415) 546 1295
 
         use your Head or lose your Mind!  http://www.BurnCycle.com
 


-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post