parameterized abstract data type using java 5.0

L

leo

Hi!

How to use new feature (parameterized abstract data type) in JAVA 5.0
to write a stack?

Ming
 
I

Ingo R. Homann

Hi,

Hi!

How to use new feature (parameterized abstract data type) in JAVA 5.0
to write a stack?

Ming

import java.util.Stack;

....
Stack<String> s=new Stack<String>();
s.push("Test");
String string=s.pop();

....or what exactly is your question?

Ciao,
Ingo
 
L

leo

I want a generic buffer in Java which operates as stack can able to
store at most 10 items of the same type (e.g. string). Thx!

Ming
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top