夜间模式暗黑模式
字体
阴影
滤镜
圆角
主题色
review java

复习了一下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);
    }
}

print

[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

浮躁的我们每天去接入不同的第三方,而忽略了本质的细节.

暂无评论

发送评论 编辑评论


				
上一篇
下一篇