android - Set Lists elements in proper / effective way in Java -


i programming in java android project. want set 0 elements list

int j = 0; for(@suppresswarnings("unused") integer integ : listitemsnum) {    listitemsnum.set(j, 0);    j++; } 

how make more effective?

you can use collections.fill(list<? super t> list, t object) method. more on this: http://developer.android.com/reference/java/util/collections.html

sample:

collections.fill(yourlist, integer.valueof(0)) 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -