Question: public class penavalerytask 1 { public static void sentenceReverser ( String sentence ) { / / Declareing the result and initializing it String result =
public class penavalerytask
public static void sentenceReverserString sentence
Declareing the result and initializing it
String result ;
Loop for characters in reverse order
for int i sentence.length; i ; i
result sentence.charAti;
Printing the sentence in reverse
System.out.printlnresult;
public static void main String args
String str "Valery Pena";
Calls the method and passes the str variable
sentenceReverserstr;
is this AI generated
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
