My input is coming from a socket using DataInputSteam and because I can have several different String values all being assigned to same clientDay
socket
DataInputSteam
clientDay
Thanks Prasaanth, that's what I was doing wrong.
I needed my ArrayList ar = new ArrayList(); to be global and simplified the rest as follows inside my method.
ArrayList ar = new ArrayList();
dataInputStream = new DataInputStream( socket.getInputStream()); ar.add(dataInputStream.readUTF()); System.out.print("ar: "+ar);