Modifying Setters In Java May 30, 2018 The code below eliminates spaces at the beginning or end of a name entered by the user, it tries to remove the spaces inside the setter method of a bean.