Pomogło, ale na żółto jest podkreślone prawie wszystko w eclipse i jest przy odpowiednich linijkach napisane:
The serializable class ListaString does not declare a static final serialVersionUID field of type long
ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized
Type safety: The method add(Object) belongs to the raw type ArrayList. References to generic type ArrayList<E> should be parameterized
Type safety: The method add(Object) belongs to the raw type ArrayList. References to generic type ArrayList<E> should be parameterized
Nie sądzę by było to poprawne i nie wiem co to oznacza. Kod przedstawia się następująco:
class ListaString extends ArrayList{
public void add(int index, Object element) {
super.add(element);
}
}
public class Test {
public static void main(String[] args) {
ListaString lista = new ListaString();
lista.add("tekst");
lista.add("tekst2");
System.out.println(lista);
}
Mógłbym prosić o przykład jak powinno to być odpowiednio zrobione? Analizując go więcej się nauczę.