title: Can't i initialized empty String array and pass in the value afterwards in Java?
body: <p>I can't seems to find out what what is wrong with my codes? i can't pass in non-empty String value into an empty String array?</p>
  
  <pre><code>String[] profiles = wifiPositioningServices.GetAllProfileData();
  
  ArrayList&lt;String[]&gt; macAddresses = new ArrayList&lt;String[]&gt;();
  String[] macAddressTemp=null;
  
      //store all profile data into a ArrayList of Profile objects
      for(int i=0; i&lt;profiles.length; i++){
          String[] result = profiles[i].split(",");
          Profile profile = new Profile();
          profile.setProfileName(result[0]);
          profile.setOwner(result[1]);
          profile.setMap(result[2]);
          profile.setVisible(result[3]);
          boolean visible = Boolean.valueOf(result[3]);
          if(visible){
              //if visible is true, then add profile name and mac filters into arraylist 
              profileNames.add(result[0]);
              int cnt=0;
              for(int j=4; j&lt;result.length; j++){
                  profile.setMacFiltersList(result[j]);
                  Log.e("Text:", result[j]);
                  macAddressTemp[cnt] = result[j];
                  ++cnt;
              }
              macAddresses.add(macAddressTemp);
          }
          profileList.add(profile);
      }
  </code></pre>
  
  <p>Java show a nullpointer exception at the line "macAddressTemp[cnt] = result[j];". I am sure that result[j] is not empty cause i was able to print it out via the log msg.</p>