Posted By:
yoann_jagoury
Posted On:
Thursday, January 30, 2003 08:38 AM
Did anyone come accross this problem: You have an interface defining a method (e.g. getInt()) You have an abstract class implementing this interface but not the method. You have an object implement this abstract class. When using the method defined in the interface through the abstract class you get an annoying: java.lang.AbstractMethodError like this: ITest.java: public interface ITest { int getInt(); } AbstractTest.java: public abstract class AbstractTest implements ITest{} SimpleTest.java: public class SimpleTest extends AbstractTest { public int
More>>
Did anyone come accross this problem:
You have an interface defining a method (e.g. getInt())
You have an abstract class implementing this interface
but not the method.
You have an object implement this abstract class.
When using the method defined in the interface through
the abstract class you get an annoying:
java.lang.AbstractMethodError
like this:
ITest.java:
public interface ITest {
int getInt();
}
AbstractTest.java:
public abstract class AbstractTest implements ITest{}
SimpleTest.java:
public class SimpleTest extends AbstractTest {
public int getInt() {return 1;}}
Test.java:
public class Test
{
public static void main(String[] args)
{
use(new SimpleTest());
}
static void use(AbstractTest test)
{
test.getInt();
}
}
could this be an AS400 JVM bug : OS400 V5R1 using java 1.3
<<Less