Java is quite strange when it comes to arrays, and doesnt really make suence unless you understand pointers to pointers in c/c++.
In Java, to Create an Array or N objects..
// Create an Array of Objects...
Object[] Array = new Object
;
// Fill The Array With Object.
for(int I=0; I<N;I++)
{
Array[I] = new Object;
}
In Your Code, You Create An Array (pointer to pointers)
but dont create new objects inside the array... and therefor, causing a memory access violation.
HOWEVER,,, your array is only 1 object in size... you dont need an array.,, just create the new object.
Enter your message below
Sign in or Join us (it's free).