N
N
Neonoviiwolf2017-04-05 01:12:43
Node.js
Neonoviiwolf, 2017-04-05 01:12:43

ArrayList remove internal array using reference?

Good
I will describe in brief, otherwise the code will be a sheet of unnecessary code. The situation is this. There are two arrays:

ArrayList<String> arrayString = new ArrayList<>
ArrayList<ArrayList> array = new ArrayList<>
array.add(arrayString) // i раз

so the number of arrayString is unlimited, i.e. array will have i number.
Then I send one of the arrayString to another class
//типо такого
myClass.array(array.get(5));

I get in class
private ArrayList arrayString ;
    public  array(ArrayList<String> arrayString ) {
this.arrayString = arrayString;
........
this.arrayString = null //тут я надеялся занулить сам массив, но занулил ссылку на него
    }

so after executing the further code, I need to nullify arrayList.get(5) = null and delete it, but I would like to do it somehow through this.arrayString = null, but alas, I nullify the link to arrayList.get(5) , not the element itself from arrayList. It is extremely unreliable to pass the array index itself, because the array often changes its size, how to get out?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Tkachev, 2018-03-27
@VladimirTkachev

Maybe try installing the latest node and install the new npm with it?

D
Dmitry Alexandrov, 2017-04-05
@jamakasi666

this.arrayString= new ArrayList<>();
hmm, I re-read the question and realized that I didn’t understand what exactly the author wants to get.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question