Results 1 to 2 of 2
  1. #1
    pyler is offline Member
    Join Date
    Jul 2012
    Posts
    18
    Rep Power
    0

    Default toString Method for a linked stack

    Hi
    I have a linked stack class
    When I create an stack object say
    Java Code:
    stackObj
    and push items onto it, I expect
    Java Code:
    System.out.println(stackObj)
    to show the items on the stack but instead I get some address like
    Java Code:
    LinkedStack323t4244
    , I have no Idea what to return in the toString() method of the LinkedStack class so any helps is appreciated.

  2. #2
    pyler is offline Member
    Join Date
    Jul 2012
    Posts
    18
    Rep Power
    0

Similar Threads

  1. toString Method
    By hndlz in forum New To Java
    Replies: 9
    Last Post: 04-20-2012, 04:45 AM
  2. Replies: 3
    Last Post: 05-12-2011, 06:07 AM
  3. Stack Implemented Linked List HELP!!!!!!!!!
    By dudedatroz in forum NetBeans
    Replies: 1
    Last Post: 02-19-2010, 11:56 PM
  4. toString() method
    By 01allenh in forum New To Java
    Replies: 2
    Last Post: 03-26-2009, 12:43 AM
  5. toString method
    By apfroggy0408 in forum New To Java
    Replies: 6
    Last Post: 01-31-2008, 05:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •