stack class : Peek() method

Description

Returns the instance at the top of the stack without removing.

Syntax

stackInstance.Peek()

Arguments

None

Return value

ClassDescription
someClassThe instance of the top of the stack.

Sample code

//anyStack is a instance of stack{string} type.

string str = anyStack.Peek();

Notes

It's a wrapper of the System.Collections.Generic.Stack<t>.Peek().

Links for reference

Copyright © Rice All rights reserved.