Java Substring Method Return Type