review java

2016-06-20 0 条评论 172 次阅读 0 人点赞

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

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

TestSmirk

这个人太懒什么东西都没留下

文章评论(0)