* create
```
import java.util.*;
class Main {
public static void main (String[] args) {
Stack<Integer> s = new Stack<>();
}
}
```
* iterator: Java stack has iterator, but it is a bad design. A stack that can be iterated is no different from a plain vector.
* add
```
import java.util.*;
class Main {
public static void main (String[] args) {
Stack<Integer> s = new Stack<>();
s.push(1);
System.out.println(s);
}
}
```
* change (N/A)
* query
```
import java.util.*;
class Main {
public static void main (String[] args) {
Stack<Integer> s = new Stack<>();
s.push(1);
System.out.println(s.peek());
System.out.println(s.empty());
System.out.println(s.size());
}
}
```
* delete
```
import java.util.*;
class Main {
public static void main (String[] args) {
Stack<Integer> s = new Stack<>();
s.push(1);
System.out.println(s.peek());
s.pop();
System.out.println(s.empty());
System.out.println(s.size());
}
}
```