Question: Problem # 4 ( Code 2 ) Write a public static method called print 2 which returns a String and has one String parameter: str
Problem #Code
Write a public static method called print which returns a String and has one String parameter: str This method does exactly the same thing as print from the previous question. The method returns a String where each line has a new letter from starting with the last letter first and adding new letters from right to left You can assume a nonnull String will be passed in for str For this method you should use a nested loop. As for library methods, you can only use the String methods: length and charAt. If you have a System. out. println in your code, you are not writing the code correctly. No need for a main. Obviously, you cannot just call your print code and you must redevelop the logic with the new given restrictions.
tableSample calls,Output of the callsSystemout.printlnprintComputer ;tablererter
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
