Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 539 Bytes

File metadata and controls

38 lines (28 loc) · 539 Bytes

Iterations

  1. List array
public void test(List<String> words ) {
    for (String word : words) {
        System.out.println(word);
    }
}
  1. Arrays
public void dsp(int[]  nums) {
    System.out.println(Arrays.toString(nums));
    for (int num : nums) {
        System.out.printn(num);
    }
}
  1. Stack
Deque<Character> stack = new ArrayDeque<>();
stack.push('a');
stack.push('b');

Iterator<Character> iter = stack.iterator();

while(iter.hasNext()){
    System.out.println(iter.next());
}