5.15 LAB: Reverse array Use Python. Complete reverse() method that returns a new character array containing all contents in the parameter reversed. Ex: If the input array is: ['a', 'b', 'c'] then the...



5.15 LAB: Reverse array


Use Python.




Complete reverse() method that returns a new character array containing all contents in the parameter reversed.


Ex: If the input array is:


['a', 'b', 'c']

then the returned array will be:


['c', 'b', 'a']



import java.util.*;
public class LabProgram {


// This method reverses contents of input argument arr.
public static char[] reverse(char[] arr) {
            /* Type your code here. */
}


public static void main(String[] args) {
char [] ch = {'a','b','c'};

System.out.println(reverse(ch)); // Should print cba
}
}





Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here