This was the question
e) Write a loop that prints to the screen the last letter in each string stored in a String array named stringArray starting with the first String in the array and ending with the last. (Example: if stringArray = {“Hello”, “my”, “name”, “is”, “Bob”} your loop should print
So I just want to double check, if my answer seems right.
ThanksCode:int j = stringArray.length;
for(int i=0; i<j; i++) {
String last = stringArray.[i](stringArray[i].length()-1);System.out.println(last);
}
