Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0344 Swap element in a list

static void swap(List<?> list, int i, int j) Swaps the elements at the specified positions in the specified list.