Given an element of an ArrayList, something like:
List<String> bunchOfLetters = new ArrayList<String>();
and a standard method to add some letters to it, say
public void makeUpSomeLetters(){
bunchOfLetters.add("abcdefg");
I understand that to traverse an ArrayList to inspect elements
I need to do
for(int i = 0; i<bunchOfLetters.size(); i++)
{
but I am clueless how to add whitespace to the end of it, e.g. making the end result become something like:
[abcdefg ]
as opposed to just
[abcdefg]
purpose: I would like to add said whitespace so that I may take a substring for said element without having the console omit characters. thank you for your time.
Cheers!
OUTPUT: