I have a String array of size 1000:
String[] subStrStore = new String[1000];
I have only 6 elements in the array. If I sort it using:
Arrays.sort(subStrStore);
I am getting a null pointer exception because it tries to compare null elements. How can solve this problem?