First, let's find out why Java thinks it new Point[3]creates a common array, and Pointnot a common class. This is because it Pointis a non-static class, which means that it contains a hidden link to a Foo<T>built-in compiler. The class looks like this: Java:
class Foo$Point<T> {
Foo<T> _hidden_Foo;
float x, y;
}
Foo$, <T> _hidden_Foo , , , Point Foo<T>.
:
static Point, , , . . ajb. Point Foo<T> membersstatic , List<Point> , . , .
:
public class Foo<T> {
void someMethod() {
List<Point> points = new ArrayList<Point>();
...
}
class Point {
float x, y;
}
}