I am testing to throw out a value in the array, like myarray={"9","0","8"} change to array={"9","8"}
Code:
String location[] = request.getParameterValues("select"
java.util.Stack stack = new java.util.Stack();
int losize=java.lang.reflect.Array.getLength(location);
for(int j=0;j<losize;j++)
{
if(location[j] !="0"
stack.push(location[j]);
}
while (!stack.isEmpty())
out.println(stack.pop()+"<br>"
But the output is just the reversed order, "0" still in there, like {9,0,8}, become {8,0,9} only, what's wrong?
Code:
String location[] = request.getParameterValues("select"
java.util.Stack stack = new java.util.Stack();
int losize=java.lang.reflect.Array.getLength(location);
for(int j=0;j<losize;j++)
{
if(location[j] !="0"
stack.push(location[j]);
}
while (!stack.isEmpty())
out.println(stack.pop()+"<br>"
But the output is just the reversed order, "0" still in there, like {9,0,8}, become {8,0,9} only, what's wrong?