queue
-
Java - Stack, QueueJava 2018. 1. 25. 13:12
// Stack - LIFO// 마지막에 들어온 최신 것을 이용할 때 유용 // Queue - FIFO// 순차적으로 작업 처리할 때 유용 import java.util.Stack; public class TowelBox { public static void main(String[] args) { // Stack -> LIFO Stack box = new Stack(); // push box.push(new Towel("red")); box.push(new Towel("orange")); box.push(new Towel("yellow")); box.push(new Towel("green")); box.push(new Towel("blue")); box.push(new Towel("na..