a class that stores each line info on a ArrayList. How do i prevent the program to create 3 new objects when the first line and second line only have different years?
why you use arraylist? i think you create a class with three property and then create object per each line then override hashcode of class with your condition now you just create a set<class> of this class and then when you add a object to this set if hashcode was equal, then set feature prevent to add that object
Обсуждают сегодня