Skip to Content
VB.NET Language in a Nutshell, Second Edition
book

VB.NET Language in a Nutshell, Second Edition

by Steven Roman PhD, Ron Petrusha, Paul Lomax
April 2002
Intermediate to advanced
688 pages
19h 51m
English
O'Reilly Media, Inc.
Content preview from VB.NET Language in a Nutshell, Second Edition

Name

Stack.Pop Method

Class

System.Collections.Stack

Syntax

                  stackvariable.Pop(  )

Return Value

Object

Description

Removes the top item from the stack and returns it as an Object

Rules at a Glance

  • Pop removes the top item from the stack and decrements the Count property by one.

  • Pop generates an error if applied to an empty stack. Thus, it’s advisable to determine when a stack is empty by using the Count property before popping the stack.

Programming Tips and Gotchas

The Peek method returns a reference to the object at the top of the stack, but unlike the Pop method, does not remove it from the stack.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

VB .NET Language in a Nutshell

VB .NET Language in a Nutshell

Steven Roman PhD, Ron Petrusha, Paul Lomax

Publisher Resources

ISBN: 0596003080Supplemental ContentCatalog PageErrata