getting to grips with Java String methods