Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: When use Collection Framework?

  1. #1
    Member hexwind's Avatar
    Join Date
    May 2011
    Location
    Tunisia
    Posts
    48
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default When use Collection Framework?

    Hello guys,
    As I finished learning about Collection Framework, there is this question that i couldn't find an answer for.
    When to use this framework? Only when i'm manipulating data that is stored temporarely?
    For example, i wrote an address book program that manipulates the data using the CF. But once the program stops running, i use all the data. I know i could use a database or a file, but once i use either of these, does it mean i won't use the CF anymore?
    I'm a bit confused.
    Thanks for your replies guys in advance
    My website : MediDev


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,351
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: When use Collection Framework?

    If you want the data you have stored in memory to persist when the program is not running you will have to write it to a file or DB.
    Data is kept in memory so that it can be worked with by your program. It depends on your application as to how much of the data needs to be in memory or can remain on disk.

  3. #3
    Member hexwind's Avatar
    Join Date
    May 2011
    Location
    Tunisia
    Posts
    48
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: When use Collection Framework?

    So i can use the collections framework only when i'm manipulating data that is stored in memory during run-time?
    My website : MediDev

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,351
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: When use Collection Framework?

    Not sure what you are asking.
    If a program is not running, there is no data stored in memory.
    The CF is part of the code that is loaded into memory with your program.
    You use the CF as a tool to manipulate/store data in memory.

  5. #5
    Member hexwind's Avatar
    Join Date
    May 2011
    Location
    Tunisia
    Posts
    48
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: When use Collection Framework?

    That was not what I was talking about.
    I meant, if I want to use the data from my database and manipulate them with CF, i have to extract them first, put them in a list for example, and then manipulate them?
    I just thought there is a way to store your data in a list or set for example.
    My website : MediDev

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,351
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: When use Collection Framework?

    a way to store your data in a list
    Where is the data when it is stored? Probably on disk somewhere.
    To get the data into your program you will need to read it from disk.
    There are many ways to do this, depending on how the data is stored.

  7. #7
    Member hexwind's Avatar
    Join Date
    May 2011
    Location
    Tunisia
    Posts
    48
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: When use Collection Framework?

    You didn't get my point again unfortunately. I just thought that there is a way to store your data in a list like in a database or a file.
    My website : MediDev

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,351
    Thanks
    49
    Thanked 2,204 Times in 2,177 Posts

    Default Re: When use Collection Framework?

    I just thought that there is a way to store your data in a list like in a database or a file.
    I said: Where is the data when it is stored? Probably on disk somewhere.
    DB and files are on disks or some kind of permanent storage.

    No, I don't have any idea what your point is.
    Data is store in some storage like a disk file when the program is not running and/or the computer is turned off.

Similar Threads

  1. Synchronized Collection
    By tcstcs in forum Java Theory & Questions
    Replies: 2
    Last Post: March 29th, 2011, 12:09 AM
  2. Looking for Collection class to do first if first out
    By snytkine in forum Collections and Generics
    Replies: 5
    Last Post: October 7th, 2010, 09:18 PM
  3. Collection.sort problem
    By Minken in forum What's Wrong With My Code?
    Replies: 12
    Last Post: September 21st, 2010, 06:24 PM
  4. Java Garbage Collection and destructors
    By riddhik84 in forum Java Theory & Questions
    Replies: 5
    Last Post: October 1st, 2009, 09:06 AM
  5. Garbage Collection?
    By kalees in forum Collections and Generics
    Replies: 6
    Last Post: September 23rd, 2009, 03:07 AM