4 Replies Latest reply: May 16, 2008 2:17 AM by 807601 RSS

    NullPointerException with array


      I'm working on an assignment at the moment, however there's just this one peice of code that i cant seem to get to work.
           public static void barcodeSort()
                final int dvdCount = modDvd.getDvdCount();
                String[] a = new String[dvdCount];
                for( int i = 0; i < dvdCount; ++i )
                     a[i] = modDvd.dvds.getBarcode();
                sort.selecSort( a );
      It throws a NullPointerException when i run the code, and after about an hour and a half of trying to find an answer, i thought someone here might be able to help.