I want to convert an array into Arraylist.But i don't want to make a new copy of that array.I want that Arraylist to be reference of that array.
For e.g
var arr[] = {"abc","def","ghi"}
List tempList = new ArrayList();
for(String val:arr){
tempList.add(val)
}
for(Iterator iterator= tempList.listIterator();tempList.hasNext()){
String temp = iterator.next();
if(temp == "def"){
tempList.remove(temp);
}
}
arr = tempList.toArray(tempList.size());
Now this is a test example of what i actually want to do .And here i am fist manipulating the list then converting it into array ,then replacing the "arr" with new array from the list. But is it possible that if i remove a value from the templist then it gets removed from arr like value by reference?