Logo

Programming-Idioms

History of Idiom 44 > diff from v12 to v13

Edit summary for version 13 by :

Version 12

2015-08-21, 16:54:24

Version 13

2015-08-21, 23:19:50

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Imports
import java.util.List;
Imports
import java.util.List;
Code
s.add(i, x);
Code
s.add(i, x);
Doc URL
http://docs.oracle.com/javase/7/docs/api/java/util/List.html#add%28int,%20E%29
Origin
http://docs.oracle.com/javase/7/docs/api/java/util/List.html#add%28int,%20E%29