String Arrays


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: String Arrays

  1. #1
    Join Date
    Jan 2007
    Posts
    1

    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 01:08 AM.

  2. #2
    Join Date
    Dec 2006
    Location
    Kerala,India
    Posts
    51
    you have not initialized the array aArray. You have to initialize aArray before the for loop

Similar Threads

  1. Input string was not in a correct format
    By mdengler in forum ASP.NET
    Replies: 0
    Last Post: 11-26-2002, 03:32 PM
  2. Replies: 1
    Last Post: 06-05-2001, 07:12 AM
  3. How do I detect an FTP timeout?
    By Julian Milano in forum VB Classic
    Replies: 0
    Last Post: 08-10-2000, 10:16 PM
  4. Please help me -- urgent -- deadlock error
    By chandra in forum VB Classic
    Replies: 0
    Last Post: 06-22-2000, 08:36 AM
  5. Database problems
    By Robert Rieth in forum VB Classic
    Replies: 1
    Last Post: 04-11-2000, 04: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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center