Had a particular problem with a homework assignment trying to print an array. I have no specific code...not looking for a specific answer. It was printing hash code using the print method and consensus is that the .toString() method solves the problem. I couldnt get this to work but found the second answer here:
https://stackoverflow.com/a/19845901/7262393
My question is (if it can be answered generally), why wouldnt I just use a .get() method and loop through all the elements as suggested in this answer? Is there any particular reason one is used over the other? I assume the .toString method is a loop that goes and converts each element to a string and then prints them.
Thanks