72.9k views
4 votes
JAVA

Write a method that takes the last two values of a String and adds those two values three more times on to the end of the String.

For example, repeatTwo("karel") would return "karelelelel".

public static String repeatTwo(String word){
}

1 Answer

2 votes

Answer:

Is in the provided screenshot

Step-by-step explanation:

Get the last two characters and concatenate.

JAVA Write a method that takes the last two values of a String and adds those two-example-1
User Kurt Raschke
by
5.6k points