Skip to content

Instantly share code, notes, and snippets.

@locisvv
Created March 13, 2012 15:30
Show Gist options
  • Save locisvv/2029416 to your computer and use it in GitHub Desktop.
Save locisvv/2029416 to your computer and use it in GitHub Desktop.
package org.uzhnu.homework;
public class Driver {
public static void main(String[] args) {
String a[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19","20"};
//String a[] = {"0"};
Stack my_stack = new Stack();
Stack my_stack2 = new Stack(a);
Stack my_stack3 = new Stack(a);
for(int n=0; n<10; n++){
my_stack.pus(" - " + n);
}
System.out.println("Конструктор за замовчуванням");
for(int n=0; n<10; n++){
System.out.println(my_stack.pop());
}
System.out.println("Конструткор із параметрами");
for(int n=0; n<a.length; n++){
System.out.println(my_stack2.pop());
}
System.out.println(my_stack.pop());
System.out.println(my_stack.pop());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment