Write a method, roto, that takes a String, inputStr, as a fo…
Write a method, roto, that takes a String, inputStr, as a formal parameter and returns a String. The method should return inputStr, but its last two chars should be moved to the front of inputStr. You may assume that inputStr will be length at least 2. (just run the input output examples shown below from your main with the input strings hardcoded — print out the returned values from each call to see your method is working; no scanner needed!) Examples: roto(“Hello”) should return: “loHel” roto(“HoHa”) should return: “HaHo” roto(“Go”) should return: “Go”
Read Details