Suppose I have a list of an object called Option :
List<Option> opts = ArrayList<Option>();
I have override toString() for the object Option.
when I do opts.toString() that means I do toString for a List , I get some unnecessary commas ,,,,,.
I would like to change that. Please, is there a way better then for-looping inside the List to toString each element ? Hope I am clear.
I guess not a good idea to override
toStringofArrayList, but you can create your own print function in some Utility class of your application: