interfaces and sub-class implementations

Nic Ferrier nferrier@tapsellferrier.co.uk
Sun Apr 21 17:59:00 GMT 2002


I found a few problems with source and native compilation where
interface methods not being implemented by the implementing class.
I'll report these later on (probably after the 3.1 release unless
people are desperate for bugs to fix /8-) but here's the jist:
 public interface Thingy
 public void someOperation (int x);
 public int anOperation (String x);
 public abstract class DooDah
 implements Thingy
 public void someOperation (int x)
 { }
 public class ThingumyJig extends DooDah
 public int anOperation (String x)
 {
 return "ha!";
 }
The above (or something analagous to the above) won't source compile.
One can make it compile by adding an abstract implementation of the
missing interface method, eg:
 public abstract class DooDah
 implements Thingy
 public void someOperation (int x)
 { }
 public abstract int anOperation (String x);
will fix the problem.
In certain circumstances native compilation won't happen either.
Just thought I'd let you know, as I say, I'll put a proper bug
together.
Nic


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /