parameterized abstract data type using java 5.0

Discussion in 'Java' started by leo@tech-trans.com, Jun 29, 2005.

  1. Guest

    Hi!

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

    Ming
    , Jun 29, 2005
    #1
    1. Advertising

  2. Hi,

    wrote:
    > 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
    Ingo R. Homann, Jun 29, 2005
    #2
    1. Advertising

  3. Guest

    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
    , Jun 29, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DaKoadMunky
    Replies:
    4
    Views:
    537
    Lee Weiner
    Apr 20, 2004
  2. Matthias Kaeppler
    Replies:
    1
    Views:
    417
    R.F. Pels
    May 22, 2005
  3. Sameer
    Replies:
    4
    Views:
    572
    Roedy Green
    Aug 31, 2005
  4. Uzytkownik
    Replies:
    3
    Views:
    577
    Uzytkownik
    Apr 3, 2005
  5. Stefan Ram
    Replies:
    27
    Views:
    713
    Stefan Ram
    Aug 17, 2009
Loading...

Share This Page