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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!