Skip to content

Instantly share code, notes, and snippets.

@appikonda
Last active January 20, 2017 19:30
Show Gist options
  • Save appikonda/242a80f12a567e77d57e1359acc5700c to your computer and use it in GitHub Desktop.
Save appikonda/242a80f12a567e77d57e1359acc5700c to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class getIndexs {
public static void main(String[] args) {
// TODO Auto-generated method stub
List<Integer> fooList = new ArrayList<Integer>();
List<Integer> booList = new ArrayList<Integer>();
for (int i = 0; i < 5; i++) {
fooList.add(i, i+1);
}
for (int i = 0; i < 5; i++) {
booList.add(i, i+9);
}
for (Iterator iterator = booList.iterator(); iterator.hasNext();) {
Integer i = (Integer) iterator.next();
//call printInt();
}
}
private void printInt(int a, int b){
System.out.println(a +" "+b );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment