Assigning a value to the String array - geting exception

10-11  Source: Network gathering  Views:0 

Advertisement
Hi,
All I'm trying to do is
String[] appName = null;
appName[0] = "all";
This is throwing a Null Pointer Exception!
Of course it is. You have to init. the object. Ex:
String[] appName = null;
appName = new String[1];
appName[0] = "all";
or even better:
String[] appName = new String[1];
appName[0] = "all";
Related articles