Problems with calling inherited methods
Edgar Villanueva
edgarvil@home.com
Sun Jan 14 11:54:00 GMT 2001
There's a problem with compiling classes that call inherited methods.
Here is a class that shows the problem.
import java.util.*;
public class MyLinkedList extends LinkedList
{
public static void main(String args[])
{
MyLinkedList t = new MyLinkedList();
if (t.isEmpty())
System.out.println("list is empty");
else
System.out.println("list has something");
}
}
Here is the error:
[m[edgar@edgar4 temp]$ gcj -c MyLinkedList.java
MyLinkedList.java: In class `MyLinkedList':
MyLinkedList.java: In method `main(java.lang.String[])':
MyLinkedList.java:10: Can't find method `isEmpty()' in type
`MyLinkedList'. Candidates are:
`isEmpty()' in `java.util.List'
`isEmpty()' in `java.util.AbstractCollection'.
if (t.isEmpty())
^
1 error
Helping to make gcj better.
More information about the Java
mailing list