Good afternoon.
I am currently doing a program, which has a LinkedList, at the moment of wanting to apply the Method lista.contains ("Mario") returns false, it should be noted that the list is filled according to a class of the following shape ;
lista.add(new VideojuegoBean("Fifa 2017", "Deporte",120,"5","A"));
lista.add(new VideojuegoBean("Halo", "Accion", 295,"2","B"));
lista.add(new VideojuegoBean("PES 2014", "Deportes", 309,"4","C"));
lista.add(new VideojuegoBean("Gears ", "Accion", 409,"3","B"));
lista.add(new VideojuegoBean("Mario", "Fantasia", 509,"1","A"));
lista.add(new VideojuegoBean("Mario Word", "Fantasia", 609,"4","C"));
For which I understand you should return true since it is in the list if it contains it, the other data in parentheses are part of the attributes of the class VideogameBean, It should be noted that if I apply the function
form.getLista().indexOf("Mario");
I should return the index but it returns -1 and I think this happens because it is not found.
Try to try several forms but none can determine if the list contains any element.
Hopefully you can guide me to know if I'm using a method wrong.
The list view is displayed like this;
VideojuegoBean{titulo=Fifa 2017, genero=Deporte, cantidadJugadores=5, clasificacion=A, codigo=120}
VideojuegoBean{titulo=Halo, genero=Accion, cantidadJugadores=2, clasificacion=B, codigo=295}
VideojuegoBean{titulo=PES 2014, genero=Deportes, cantidadJugadores=4, clasificacion=C, codigo=309}
VideojuegoBean{titulo=Gears , genero=Accion, cantidadJugadores=3, clasificacion=B, codigo=409}
VideojuegoBean{titulo=Mario, genero=Fantasia, cantidadJugadores=1, clasificacion=A, codigo=509}
VideojuegoBean{titulo=Mario Word, genero=Fantasia, cantidadJugadores=4, clasificacion=C, codigo=609