Here s my problem.
I have 2 vectors. myVector and temp.
If myVector is empty or equal to null I just want to copy the value of temp into it.
If myVector is not empty then I want to append temp to it.
Here is my code:
The code works fine when myVector is equal to null.Code:if (myVector == null){ myVector = DocParser1.getVector(); System.out.println("Vector equals null" + myVector); } else { myVector.addAll(temp); System.out.println("Vector does not equal null" + myVector); }
But if I add this line of code..
myVector.add(0,"HELLO");
Before the block if statement then nothing happens. Even the println statement does not execute.
I have tried the isEmpty function.
Any ideas?




Reply With Quote