public void QueueContentsCopy(DefinedQueue localQueue) { BankCustomer tempCustomer = new BankCustomer(); DefinedQueue copyoflocalQueue = new DefinedQueue(); // make the copy copyoflocalQueue = (DefinedQueue)localQueue.Clone(); Console.WriteLine(" "); Console.WriteLine("View the queue using a copy"); do { tempCustomer = (BankCustomer)copyoflocalQueue.Dequeue(); Console.WriteLine("Name: " + tempCustomer.name + ", Activity: " + tempCustomer.bankingActivity + ", Account no: " + tempCustomer.accountNumber.ToString() + ", Amount $" + tempCustomer.amount.ToString()); } while (copyoflocalQueue.Count != 0); }