2d Array Help
I'm trying to make a 2d Array of Point2D, but it won't accept it. Here's what I got so far. All the variables (a, b, xlim, ylim) have been declared already...
Point2D[][] corners
Point2D[] tl =
{
new Point2D.Double(a-b, a-b),
new Point2D.Double(a+b, a-b),
new Point2D.Double(a+b, a+b),
new Point2D.Double(a-b, a+b)
};
Point2D[] tr =
{
new Point2D.Double((xlim-a)-b, a-b),
new Point2D.Double((xlim-a)+b, a-b),
new Point2D.Double((xlim-a)+b, a+b),
new Point2D.Double((xlim-a)-b, a+b)
};
Point2D[] bl =
{
new Point2D.Double(a-b, ylim-a-b),
new Point2D.Double(a+b, ylim-a-b),
new Point2D.Double(a+b, ylim-a+b),
new Point2D.Double(a-b, ylim-a+b)
};
Point2D[] br =
{
new Point2D.Double((xlim-a)-b, (ylim-a)-b),
new Point2D.Double((xlim-a)+b, (ylim-a)-b),
new Point2D.Double((xlim-a)+b, (ylim-a)+b),
new Point2D.Double((xlim-a)-b, (ylim-a)+b)
};
corners = { tr, tl, bl, br };
The last line's where the error is. It says "Array constants can only be used in initializers" How do I fix this? Thanks in advance

