I need to write a java program that has an array-returning method that takes a two-dimensional array of chars as a parameter and returns a single-dimensional array of Strings. Here's what I have
import java.util.Scanner;
public class TwoDimArray {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter the number of Rows?");
int rows = s.nextInt();
System.out.println("Enter the number of Colums?");
int cols = s.nextInt();
int [][] array = new int [rows] [cols];
}
public static char[ ] toCharArray(String token) {
char[ ] NowString = new char[token.length( )];
for (int i = 0; i < token.length( ); i++) {
NowString[i] = token.charAt(i);
}
return NowString;
}
}