Question: 7) Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter twice in a row)

7) Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter twice in a row) then it should return true. Otherwise, it should return false. This method must be named hasRepeat () and have a String parameter. This method must return a boolean. Calling hasRepeat ("avocado") would return false Calling hasRepeat ("spoon") would return true
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
