I have string array str[10][3], it is full of values.
Now I want to make it empty ie. delete all the values of str.
I have defined str as static, also I want empty this string from another claas in same package.
Can I use null here.
Plz suggest some way. thanks
Sure, you can use
nullbut first wonder if you really need to nullify them, because null values will mostly generate problems and require special handling. You could use the empty string""to avoid having problems withNullPointerExceptions.Just reassign a new array to the same variable will do the trick, Java will take care about collecting garbaged data: