Java ArrayList Swap swap(ArrayList dataStrs, int i, int j)

Here you can find the source of swap(ArrayList dataStrs, int i, int j)

Description

swap

License

Open Source License

Declaration

public static void swap(ArrayList<String> dataStrs, int i, int j) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;

public class Main {
    public static void swap(ArrayList<String> dataStrs, int i, int j) {
        String temp = dataStrs.get(i);
        dataStrs.set(i, dataStrs.get(j));
        dataStrs.set(j, temp);//from ww  w . j a  v a  2s  .  c  om
    }
}

Related

  1. swap(ArrayList numbers, int i, int j)
  2. swap(ArrayList data, int i, int j)
  3. swapRemove(ArrayList list, int index)