I\'m working in Java on a project that requires me to make a few \'container\' classes, if you will. Here is a simple version of one:
public class Pair{
You could extend ArrayList and override the toString() method:
public class MyArrayList extends ArrayList {
@Override
public String toString() {
// format your print here...
}
}
But this is overkill. I would just write a print utility method.
public class MyUtils {
public String toString( ArrayList extends Object> ) {
// format your print here;
}
}