projects
/
PL2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Acceso a clase
[PL2.git]
/
Pila.java
1
import java.util.Stack;
2
3
public class Pila {
4
Stack<Object> p;
5
6
public Pila(){
7
p = new Stack<Object>();
8
}
9
public void apilar(Object o){
10
p.push(o);
11
}
12
public Object desapilar(){
13
return p.pop();
14
}
15
public Object cima(){
16
return p.peek();
17
}
18
public boolean vacia(){
19
return p.empty();
20
}
21
}