This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
interfaces and sub-class implementations
- From: Nic Ferrier <nferrier at tapsellferrier dot co dot uk>
- To: java at gcc dot gnu dot org
- Date: 22 Apr 2002 01:16:12 +0100
- Subject: interfaces and sub-class implementations
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