Hello Everyone,
I'm having a lot of trouble trying to figure out how to do this, I'm a beginner and I am completely stumped.
Can anyone help me with my program. I have to convert a string array to a char 2D matrix, this is what I have so far.
public class HomeworkFourDriver
{
public static void main(String[] args)
{
// Strings required for Homework.
String[]strVector = {"octhkeugrk", "fedjigchba", "mnpqdetjhz",
"bgxlvfcdaz"};
char[][] charMatrix = new char[strVector.length][];
for (int i = 0; i < strVector.length; i++)
{
charMatrix[i++] = strVector.split(" , ");
}
System.out.println(charMatrix.length);
}
}
I'm completely stumped, I've read the book over and over and nothing, can anyone help.