I understand that when an interface is implemented all the methods it contains must be implemented, since the methods declared in an interface are abstract and only the header is declared ... That's why I do not fully understand how the iterator () method belonging to the ArrayList class works. I know it returns an instance of the iterator interface, and we can use this instance without overwriting its methods > hasNext (), next (), remove () . Why can your methods be used if we have not overwritten them and therefore we have not given them an operation? An example:
Iterator <String> mi_iterador=lista.iterator();
while(mi_iterador.hasNext()){
System.out.println(mi_iterador.next());
}
This code works perfectly, but I have never used the methods mentioned above.