Working with Strings and Arrays in Java