Joseph Burke wrote:I apologize.
The issue is a compile issue. On compiling, it tells me that this line
gets error: cannot find symbol.
it actually tells you more than that...it tells you the exact symbol it can't find:
So ask yourself - where do you declare that variable? Inside your convertToArrayHelper method. Java variables have scope. For a variable declared inside a method, the scope is that method, so once you exit it, the variable is gone.
Even if you fix this, you're going to have a lot of other issues. Your convertToArrayHelper method is declared to return an int[], but it doesn't actually return anything.
Honestly, I think your biggest problem is that you are doing too much coding at once. I never - and I mean NEVER - write more than 2-3 lines of code before I compile and
test. So let's assume that everything works up to the point where you are going to start writing your convertToArrayHelper method.
My first pass would do NOTHING but declare the method as a public static void, and have it print "I'm in the convertToArrayHelper method!!!", and then call it. If that worked, I'd then change it to have a return value. I'd then create a dummy int[] to return inside the method (note this iteration changed one line, and added only two more - the declaring of the array, and the returning of it.
Hopefully, I have a method that will print the contents of an int array written, so that I can test that what I return really has what I think it has.
The idea is that you build up your code in teeny, tiny pieces. Each time you recompile and test, you know withing 2-3 lines where the problem has to be.