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
Post a Comment