can anyone help me figure out why i have a NullPointerException? thanks
import java.io.*;
public class NameSearchProgram {
public static final int MAX_NAMES = 90000;
public static int numNames;
public static String[] names = new String[MAX_NAMES];
// BubbleSort algorithm to sort all names by their length
public static void bubbleSortByLength() {
// ... Complete this ..
for(int p=0; p < names.length; p++){
if(names[p]==null){
names[p]="expceptionNotFound";
String storeName;
for (int i=0; i<(names.length); i++){
for(int j=0; j<(names.length); j++){
if(names.length() > names[i+1].length()){
storeName = names;
names = names[i+1];
names[i+1] = storeName;
}
}
}
}
}
}