Write a class
City. The constructor takes a String parameter. This is provided for you. You need to copy the starter code from Codecheck
You provide the methods:
public String getCity()gets the name of the city
public boolean doubleLetter()determines if the city name contains a double letter. Returns true is it does. Otherwise it returns false. Note: double letter means two of the same letter next to each other. The test is case-insensitive. For example Seacliff and Lloydton have a double letters. Saratoga does not.
- The loop needs to stop on the next to the last letter (to avoid StringIndexOutOfBoundsException)
- Do not change the instance variable