Results 1 to 5 of 5
  1. #1
    getshum is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Need help with a java project! Library check out/in system

    The project is about a library system where we can check in/check out items..... right now I am stuck at returning the book back. So this is what I have so far:

    void add(String itemBorrowed)
    {
    history.add(itemBorrowed);
    }
    I was just wondering that.. we have a .add method, is there a method that is like .clear or .remove.
    I don't think we do .. so any theories and advice would help.
    thanks

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default Re: Need help with a java project! Library check out/in system

    What sort of thing is history? Its API documentation will tell you what methods it has which you can call.

  3. #3
    Anveshan is offline Member
    Join Date
    May 2011
    Posts
    22
    Rep Power
    0

    Default Re: Need help with a java project! Library check out/in system

    refer APIs

  4. #4
    getshum is offline Member
    Join Date
    Feb 2011
    Posts
    5
    Rep Power
    0

    Default Re: Need help with a java project! Library check out/in system

    Well, I forgot to mention this, sorry. It needs to match it against the history when returning the book. So when they return the book, the book is removed from history. I am not really sure how to remove it from history. suggestions?

  5. #5
    Solarsonic is offline Senior Member
    Join Date
    Mar 2011
    Posts
    261
    Rep Power
    4

    Default Re: Need help with a java project! Library check out/in system

    Looks like "history" is an ArrayList.

    Let's you return "Romeo and Juliet", you're going to use:

    Java Code:
    history.remove("Romeo and Juliet");
    and you will remove the first occurrence of "Romeo and Juliet".
    Last edited by Solarsonic; 10-22-2011 at 03:55 AM.

Similar Threads

  1. First JAVA project: scheduling system
    By dee-u in forum New To Java
    Replies: 18
    Last Post: 06-29-2011, 09:59 AM
  2. Library Assistant project help
    By jbarreto1 in forum New To Java
    Replies: 4
    Last Post: 04-27-2011, 10:57 PM
  3. help with library sub system
    By clydedoris in forum New To Java
    Replies: 12
    Last Post: 07-12-2010, 10:58 AM
  4. Replies: 6
    Last Post: 06-07-2010, 03:47 PM
  5. problem trying to log on to my video library system
    By warship in forum New To Java
    Replies: 0
    Last Post: 07-18-2007, 02:33 PM

Posting Permissions

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