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 2 of 2

Thread: Quick question, arraylists

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Quick question, arraylists

    First of all, I'm sorry if this is in the wrong place.

    Anyhow, Is there a way to write an arraylist<integer> to a file using bufferedwriter?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Quick question, arraylists

    Yes...iterate over the List and write the values (you could use Integer.toString to write strings, or use a PrintWriter to write the integer). You will need some sort of delim (new line, tab, comma, etc...)

Similar Threads

  1. Hi, quick question
    By curras in forum Member Introductions
    Replies: 1
    Last Post: March 21st, 2011, 03:21 PM
  2. Encapsulation question regarding ArrayLists
    By LDM91 in forum Collections and Generics
    Replies: 3
    Last Post: October 27th, 2010, 11:51 AM
  3. scope - quick question
    By bbr201 in forum Java Theory & Questions
    Replies: 4
    Last Post: July 28th, 2010, 08:30 AM
  4. quick question - new keyword
    By bbr201 in forum Java Theory & Questions
    Replies: 2
    Last Post: July 18th, 2010, 09:43 PM
  5. Quick Question about Mergesort
    By Shadow703793 in forum Algorithms & Recursion
    Replies: 4
    Last Post: March 4th, 2010, 05:48 PM