summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/hjp5/examples/Listing1402.java
blob: 3ccbc2c9c278d3d5c8eafa81eab1256b3cf57f33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Listing1402.java */

import java.util.*;

public class Listing1402
{
  public static void main(String[] args)
  {
    Stack s = new Stack();

    s.push("Erstes Element");
    s.push("Zweites Element");
    s.push("Drittes Element");
    while (true) {
      try {
        System.out.println(s.pop());
      } catch (EmptyStackException e) {
        break;
      }
    }
  }
}