0

I have an ArrayList that contains Event objects.Event Object is charactirised by an ID , Date and a Subject , I am printing out the contents of the Array, I tried

ArrayList.get(INDEx)

and

System.out.println(list)

(list is my Arraylist) but i get as an output :

[Metier.Event@368239c8, Metier.Event@9e89d68, 
Metier.Event@3b192d32,Metier.Event@16f65612, Metier.Event@311d617d, 
Metier.Event@7c53a9eb, Metier.Event@ed17bee] 

instead of the real content of my ArrayList (metier is the name of the package), any help please ?

Ahmed202
  • 737
  • 3
  • 7
  • 12

1 Answers1

1

The problem isn't the ArrayList. You are seeing the default toString() implementation of the Event class of the events contained in the list. Override this method in that class and you should be OK.

Mureinik
  • 297,002
  • 52
  • 306
  • 350