My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package com.lineadecodigo.java.util.collections;

import java.util.Stack;

/**
* @file Pila.java
* @version 1.0
* @author Linea de Codigo (http://lineadecodigo.com)
* @date 06-octubre-2009
* @url http://lineadecodigo.com/java/crear-una-pila-en-java/
* @description Clase que instancia y utiliza una pila
*/

public class Pila {

public static void main(String[] args) {

Stack<String> pila = new Stack<String>();

for (int x=1;x<=10;x++)
pila.push(Integer.toString(x));

while (!pila.empty())
System.out.println(pila.pop());

}
}

Change log

r191 by vcuervo on Oct 5, 2009   Diff
Crear y utilizar una pila
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 590 bytes, 27 lines
Powered by Google Project Hosting