The reason you don't see the row with A
in it is because of this line:
it1.hasNext() && it2.hasNext() && it3.hasNext() && it4.hasNext()
As soon as one of your lists is out of elements, you stop.
To fix it you have to continue to work until ALL your lists are out of elements. But, you can't just access those lists if they're out of elements, so you have to work around it.
// change && to ||
while(it1.hasNext() || it2.hasNext() || it3.hasNext() || it4.hasNext()) {
Object[] objs = new String[] { "", "", "", ""}; // empty strings
// if iterators on this row are not empty, replace with values
if(it1.hasNext()) objs[0] = it1.next();
if(it2.hasNext()) objs[1] = it2.next();
if(it3.hasNext()) objs[2] = it3.next();
if(it4.hasNext()) objs[3] = it4.next();
// now print
String tabs = "\t\t\t";
System.out.println(objs[0] + tabs + objs[1] + tabs + objs[2] + tabs + objs[3]);
}
This would be faster without the array, and instead used a strict number of objects. But I see it as cleaner and easier to refactor if we leave it as an array.