Freigeben über


Stack.Peek Method

Definition

Looks at the object at the top of this stack without removing it from the stack.

[Android.Runtime.Register("peek", "()Ljava/lang/Object;", "GetPeekHandler")]
public virtual Java.Lang.Object? Peek ();
[<Android.Runtime.Register("peek", "()Ljava/lang/Object;", "GetPeekHandler")>]
abstract member Peek : unit -> Java.Lang.Object
override this.Peek : unit -> Java.Lang.Object

Returns

the object at the top of this stack (the last item of the Vector object).

Attributes

Exceptions

if the stack is empty.

Remarks

Looks at the object at the top of this stack without removing it from the stack.

Java documentation for java.util.Stack.peek().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also