Sie können die Stack-Klasse in java.util verwenden
java.util.Stack importieren; 
öffentliche Klasse StackExample { 
  public static void main(String args[]) { 
    Stack s = new Stack(); 
    s.push("Java"); 
    s.push("Quelle"); 
    s.push("und"); 
    System.out.println("Weiter: " + s.peek()); 
    s.push("Unterstützung"); 
    System.out.println(s.pop()); 
    s.drücken("."); 
    int count = s.search("Java"); 
    while (count != -1 && count > 1) { 
      s.pop(); 
      zählen--; 
    } 
    System.out.println(s.pop()); 
    System.out.println(s.empty()); 
  } 
}
     Ich hoffe es hilft, 
     jede weitere hilfe msg me