« Back
import java.util.Stack; public class StackDemo { public static void main(String[] args) { Stack s = new Stack(); s.push("one"); s.push("two"); s.push("three"); s.push("Four"); s.push("five"); System.out.println(s); s.pop(); System.out.println(s); System.out.println(s.peek()); } }
[one, two, three, Four, five]
[one, two, three, Four]
Four
×
Report a Problem:
Description:
Submit