- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackADT.java
More file actions
Latest commit
22 lines (16 loc) · 690 Bytes
/
Copy pathStackADT.java
File metadata and controls
22 lines (16 loc) · 690 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
publicinterfaceStackADT<T> {
// Adds one element to the top of the stack.
publicvoidpush(Telement);
// Removes and returns a reference to the top element from the stack.
publicTpop();
// Returns a reference to the top element, without removing it from the stack.
publicTpeek();
// Returns true if the stack contains no elements, false otherwise.
publicbooleanisEmpty();
// Returns the number of elements in the stack.
publicintsize();
// Clears all elements from the stack
publicvoidclear();
// Returns a String representation of the stack.
publicStringtoString();
}