How to remove null from an array in java


I have written a method to delete null-values from an array i require in a program.
The method however does not appear to work the null values will not go away. it's my code snippet so far.
public void removeNull(String a)
{
for(int i=0; i {
if(ai == null)
{
fillArray(a i);
}
}
}
public void fillArray(String a int i)
{
String a2 = new Stringa.length-1;
for(int j=0; j {
if(j {
a2j=aj;
}
else if(j>i)
{
a2j=aj+1;
}
}
a=a2;
}

Thank You in advance!



Get Source Code

  Views 46   Posted on : Wednesday, May 22, 2013 9:42:45 PM
Related Tags:




Replies on "How to remove null from an array in java" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: