复习了一下Collection
import java.util.*;
public class Smirk {
public static void main(String[] args) {
Stack<string> stack = new Stack<string>();
stack.push("this is bottom");
print(stack);
stack.push("second");
print(stack);
stack.push("third");
print(stack);
stack.pop();
print(stack);
stack.pop();
print(stack);
stack.pop();
print(stack);
}
private static void print(Stack<string> stack) {
if(stack.isEmpty())
System.out.println("this stack is empty");
else
System.out.printf("%s TOP\n",stack);
}
}
[this is bottom] TOP
[this is bottom, second] TOP
[this is bottom, second, third] TOP
[this is bottom, second] TOP
[this is bottom] TOP
this stack is empty
浮躁的我们每天去接入不同的第三方,而忽略了本质的细节.
© 著作权归作者所有
文章评论(0)