processDirectory.myFile myFiles = new processDirectory.myFile;
myFiles.filename = "Foojpg";
myFiles.filename = "Bartxt";
You created the array -- but did not create the members. Hence, when you tried to access the filename variable, you'll get a null pointer exception.
Welcome to JavaRanch!
First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. Joke names and "handles" don't work at the Ranch. You can change your display name here. Thanks for your immediate attention.
Originally posted by Evil Otto:
... Is there a quick way to populate an array with objects without doing a for() loop? ...
The fill methods in java.util.Arrays might work for you, depending on what exactly you need. The drawback to this method is that each index references the same object.
[ February 16, 2006: Message edited by: marc weber ]