This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
This is not a problem so much as an observation that I don't understand. I am working with a JApplet in Netbeans, and I have an Arraylist as a Global variable, and I created it simply by using ArrayList aa;. I have a loop that loads the ArrayList, and I kept getting a null pointer error. Once I changed the ArrayList constructor to ArrayList aa= new ArrayList();, the null pointer error goes away.
I've been looking through the docs, and I can't find why this is. I thought all objects declared globally just used a default constructor? Is it different for applets?
I don't have one good reason to think that, actually. I also can't think of any time I was presented with the fact that objects were null. Probably a by-product of too many hours in an IDE and not enough in a text editor, not that it is any excuse.
subject: ArrayList not instantiating when Applet loads