To create a new array or fill it? Java Array Performance
Recently I needed to empty an array to use it later, and asked myself, what is the better option, to create a new one or fill it?
Maybe you have known this long ago, I didn’t. But now, we both know!
int freq = new int; //This is better: Arrays.fill(freq,0); //than: freq = new int;