Y
Yan
Hi.
I have plenty of experiance in C/C++, but this Java no-pointer policy
is driving me crazy. I want to create an array of references - what
would be an array of pointers in C.
I try to do the following:
JTree[] trees = new JTree[2];
....
JTree tree1 = new JTree();
JTree tree2 = new JTree();
I already have 2 trees and I want to reference them using the array,
so I do:
trees[0] = tree1;
trees[1] = tree2;
but when I try to access trees[0], for example I get a null pointer
exception. How can I do this stuff.
Thank you in advance
Yan
I have plenty of experiance in C/C++, but this Java no-pointer policy
is driving me crazy. I want to create an array of references - what
would be an array of pointers in C.
I try to do the following:
JTree[] trees = new JTree[2];
....
JTree tree1 = new JTree();
JTree tree2 = new JTree();
I already have 2 trees and I want to reference them using the array,
so I do:
trees[0] = tree1;
trees[1] = tree2;
but when I try to access trees[0], for example I get a null pointer
exception. How can I do this stuff.
Thank you in advance
Yan