Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java stack creation problem
Java stack creation problem
1. If I want to call the stack, is it at the beginning?

Import java.util. *;

Do it.

Specifically, it is to import and import java.util.stack; Do it.

2. How to create integer stack and character stack with stack?

Stack < integer & lts = new stack < integer & lt (); Only plastic stacks can be loaded.

Stack & lt character & gts = new stack & lt character & gt (); Only stacks of character types can be loaded.

3. How to destroy the stack after use?

On the issue of destruction, it is not necessary to destroy it manually. Java has an automatic recycling mechanism to automatically recycle useless stacks.