Hello, first time on a programming forum, hopefully this is in the right place and I inserted the code correctly. Anyway, I am having trouble figuring out what the problem is in the code below. I return the array and in my next line of my main method when I try to use the returned array "pointArray" I am getting an error that says "cannot find symbol". Am I misunderstanding how the return statement should return? Been trying things for the last few hours and I haven't found a solution. Still pretty new to programming, trying to learn but I don't know what else to do debugging wise.
I can post my other class if necessary but I didn't think it was. Let me know.
Thanks
public class ManyCircles { /** * @param args the command line arguments */ public static void main(String[] args) { randomPoints(5); //averagePoint(pointArray); printPoints(pointArray); //After I return from randomPoints I get a "Cannot find symbol" error here for pointArray } public static Point1080[][] randomPoints(int n) { int x; int y; //Declares 2D array Point1080[][] pointArray = new Point1080[n][2]; //Goes through n elements of the array for (int i = 0; i < pointArray.length; i++) { //For n element, give x and y values in 2nd array for (int j = 0; j < 2; j++) { x = (int) ((int) 1920 * Math.random()); y = (int) ((int) 1080 * Math.random()); pointArray[i][j] = new Point1080(x, y); } System.out.println("X " + i + " is: " + pointArray[i][0].getX()); System.out.println("Y " + i + " is: " + pointArray[i][1].getY()); } //Should return the 2D array, not returning it to main method though return pointArray; } private static void printPoints(Point1080[] V) { for (Point1080 E : V) { System.out.format("(%4d,%4d)\n", E.getX(), E.getY()); }