private static Graph<String, Integer> map;
public static void makeGraph() {
System.out.println("Graph building started...");
for (int i = 0; i < size; i++) {
for (int j = i + 1; j < size; j++) {
if (linkable(usable[i], usable[j])) {
System.out.println(usable[i] + ": " + usable[j]); <=== it does print out the String in i and j
map.addEdge(usable[i], usable[j]); <===== error here
}
}
}
System.out.println("Graph have been built");
}
//usable is an array of containing String
//linkable test if they are related
I keep getting an java.lang.NullPointerException when i run the code. Need help, 1st time using JGraph