-
String Array = NullPointerException
I am trying to fill an array of strings. However, I keep getting NULLPOINTEREXCEPTION. I cannot for the life of me figure out why. If anyone could help, it'd be a lifesaver.
This is the part of my code thats problematic-
String[] array = null;
array = spelling.split(" ");
String wrong = "";
String[] aArray = null;
BufferedReader areader = new BufferedReader(new FileReader("Dictionary 'A'.txt"));
for(int p = 0; p < areaderline; p++){
String atemp = areader.readLine();
aArray[p] = atemp;--------NullPointerException here
}
areader.close();
Last edited by snoboarder2k6; 01-17-2007 at 12:08 AM.
-
you have not initialized the array aArray. You have to initialize aArray before the for loop
Similar Threads
-
By mdengler in forum ASP.NET
Replies: 0
Last Post: 11-26-2002, 02:32 PM
-
By Fred Mayes in forum Java
Replies: 1
Last Post: 06-05-2001, 06:12 AM
-
By Julian Milano in forum VB Classic
Replies: 0
Last Post: 08-10-2000, 09:16 PM
-
By chandra in forum VB Classic
Replies: 0
Last Post: 06-22-2000, 07:36 AM
-
By Robert Rieth in forum VB Classic
Replies: 1
Last Post: 04-11-2000, 03:21 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks