Hi. I'm new to Java, so this may seem to be a really dumb question, caused by my having a total misconception of something, if so, then I apologise. I need what in other languages would be a user defined type, in this case, an object with 5 string vars as members, so I've defined that as a class.
class myClasss{public String a;public String b;public String c; etc etc}
I now need an array of 10 of these, which I declare as myClass[] myClassArray as new myClass[10]; And I want to access the elements and members with myClassArray[0].a = "blah" (meaning the 1st element in the array, and the member 'a') but I'm getting a null pointer reference error.
Can anyone point out to me just what I've misunderstood please? Cheers for any help..
Kevin
class myClasss{public String a;public String b;public String c; etc etc}
I now need an array of 10 of these, which I declare as myClass[] myClassArray as new myClass[10]; And I want to access the elements and members with myClassArray[0].a = "blah" (meaning the 1st element in the array, and the member 'a') but I'm getting a null pointer reference error.
Can anyone point out to me just what I've misunderstood please? Cheers for any help..
Kevin