Sorry I suspect the answer is easy but I’m getting annoyed at the way I’m currently doing this and was trying to find another way(old python habits, sorry).
I basically want to create a list of list(list has two integers) so for example it looks like this [[0,0], [0,1],[1,2]] and so on.
Right now the two ways I have been doing it(which I don’t think is right) is the tutorial way of:
list1.add(data);
list1.add(more_data);
final_list_of_list.add(list1);
I did some digging to find another way because I’m lazy and want to do this in one shot, so I found a command that fit my needs(in terms of getting data in)
List final_list_of_list = new ArrayList();
final_list_of_list.add(new Point(0, 0)); //and so on..
The problem with point is when I look at my beautiful data I see the ugliness of this:
[java.awt.Point[x=970,y=10], java.awt.Point[x=65,y=10], java.awt.Point[x=729,y=10]
Surely there is a easier way to add the data and still have it look nice(like the format above in my example)?
You could subclass
Pointor create your own implementation and override thetoString()method to print something prettier. I think that would be easier than trying to work with lists of lists.Perhaps something like this: