Collection systems are important in Java. The entire Collection system emerged after JDK. As the top layer of the entire system, Collection has the general functions of the entire system. For the younger brother, there are also their own merits. Next, let's take a look at the features of the shortlist and Stack.
Requirement: Use the consumer list to simulate the Stack function.
Analysis: First, you need to understand the intention of the question. The question is not difficult, but it is not easy to understand the question. This question requires that you define a set to simulate the functions of the Stack class. Then again, what are the characteristics of Stack? This requires an understanding of the Stack class. The Stack is a Stack, and its features are post-release. Its methods include Stack pressure, Stack play, and empty judgment. Once you know this, it is just a matter of course to do this. Next let's take a look at the code.
StackEnum <String> se = StackEnum <> se. push ("Hello" se. push ("Java" se. push ("World "(! String string = StackEnum <E> shortlist = shortlist <E> shortlist. addFirst (e); e; returns list. removeFirst (); inclulist. size () = 0 ;}
Once again, we can see the application of generics in Java, so knowledge needs to be accumulated. without the support of generics, we can only write specific types here.