public static void copyElements(Utils.Stack <Student> src, Utils.Stack <Student> dest) { Utils.Stack <Student> aux = new Utils.Stack <Student>(); while (!src.isEmpty()) { try { aux.push(src.pop()); } catch (MyException e) { Console.WriteLine(e.Message); } } while (!aux.isEmpty()) { try { dest.push(aux.pop()); } catch (MyException e) { Console.WriteLine(e.Message); } } }
public List <T> toArray() { List <T> crepo = new List <T>(); Utils.Stack <T> stackcopy = this.getAll(); int i = 0; while (!stackcopy.isEmpty()) { crepo.Add(stackcopy.pop()); } return(crepo); }