+ Reply to Thread
Page 1 of 5
1 2 3 ... LastLast
Results 1 to 10 of 48

Thread: Hey C.C, long time no see !

  1. #1
    Code Warrior Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n's Avatar
    Join Date
    May 2008
    Location
    4chan.org/g/
    Age
    20
    Posts
    3,836
    Blog Entries
    4

    Hey C.C, long time no see !

    Well first post since a long time. Anyways I need help with, how do I create an ArrayList that saves every element to a file?
    I have created an ArrayList and it is functional, however how do I make it save the elements to a file?
    Anyone that could provide some tips and help for me?
    Thanks in advance guys !

    Hatsune Miku ~❤❤❤
    初音ミク。~❤❤❤

  2. #2
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    Re: Hey C.C, long time no see !

    Um I haven't tried this but try:

    Code:
    PrintWriter fout = new PrintWriter(new FileWriter("OUT.txt"));
    for (int index=0;index<arlNums.size();index++) {
    fout.println(arlNums.get(index));
    }
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  3. #3
    Code Warrior Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n's Avatar
    Join Date
    May 2008
    Location
    4chan.org/g/
    Age
    20
    Posts
    3,836
    Blog Entries
    4

    Re: Hey C.C, long time no see !

    Quote Originally Posted by chili5 View Post
    Um I haven't tried this but try:

    Code:
    PrintWriter fout = new PrintWriter(new FileWriter("OUT.txt"));
    for (int index=0;index<arlNums.size();index++) {
    fout.println(arlNums.get(index));
    }
    Ok, going to try and need to rush out now, thanks for your help !

    Hatsune Miku ~❤❤❤
    初音ミク。~❤❤❤

  4. #4
    Code Slinger chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5 has a reputation beyond repute chili5's Avatar
    Join Date
    Mar 2008
    Posts
    7,023
    Blog Entries
    1

    Re: Hey C.C, long time no see !

    Yeah just tried it, and it's working great.

    Code:
    import java.util.*;
    import java.io.*;
    public class al {
        public static void main(String[] args) throws IOException {
            Scanner fin = new Scanner(new FileReader("data.txt"));
            PrintWriter fout = new PrintWriter(new FileWriter("OUT.txt"));
            ArrayList alnNums = new ArrayList<Integer>();
            
            while (fin.hasNextInt()) {
                alnNums.add(fin.nextInt());
            }
    
            for (int index=0;index<alnNums.size();index++) {
                fout.println(alnNums.get(index));
            }
    
            fout.close();
            fin.close();
        }
    
    }
    That does work. Hope it helps.
    "Whenever you remember, I'll be there/
    Remember how we reached that dream together" - Carrie Underwood

  5. #5
    Code Warrior Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n's Avatar
    Join Date
    May 2008
    Location
    4chan.org/g/
    Age
    20
    Posts
    3,836
    Blog Entries
    4

    Re: Hey C.C, long time no see !

    Yep works and thanks

    Hatsune Miku ~❤❤❤
    初音ミク。~❤❤❤

  6. #6
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: Hey C.C, long time no see !

    Long time no see, Turk4n? How are you?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  7. #7
    Code Warrior Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n's Avatar
    Join Date
    May 2008
    Location
    4chan.org/g/
    Age
    20
    Posts
    3,836
    Blog Entries
    4

    Re: Hey C.C, long time no see !

    Quote Originally Posted by Xav View Post
    Long time no see, Turk4n? How are you?
    Had better days, and those days :'(

    Hatsune Miku ~❤❤❤
    初音ミク。~❤❤❤

  8. #8
    Xav
    Xav is offline
    Code Slinger Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav has much to be proud of Xav's Avatar
    Join Date
    Mar 2008
    Location
    The North Pole
    Posts
    13,210
    Blog Entries
    13

    Re: Hey C.C, long time no see !

    Lol you must be getting pretty advanced with Java, then?

    Quote Originally Posted by Jordan View Post
    Good members, like yourself, stick around and post for ages to come!
    Mr. Xav | Blog | Forums

  9. #9
    Code Warrior Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n has much to be proud of Turk4n's Avatar
    Join Date
    May 2008
    Location
    4chan.org/g/
    Age
    20
    Posts
    3,836
    Blog Entries
    4

    Re: Hey C.C, long time no see !

    Quote Originally Posted by Xav View Post
    Lol you must be getting pretty advanced with Java, then?
    Well hopefully, before my death I would like to be pro in something

    Hatsune Miku ~❤❤❤
    初音ミク。~❤❤❤

  10. #10
    Newbie eva6206213 is an unknown quantity at this point
    Join Date
    Nov 2008
    Posts
    2

    Re: Hey C.C, long time no see !

    Thank you for the info~

+ Reply to Thread
Page 1 of 5
1 2 3 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. How to add My program to Startup ?
    By kresh7 in forum Visual Basic Programming
    Replies: 52
    Last Post: 08-18-2009, 08:29 PM
  2. Help! Rlink32 Error
    By Sparky in forum Pascal/Delphi
    Replies: 6
    Last Post: 10-16-2008, 10:31 AM
  3. First post from long time Ccal lurker
    By James Argo in forum Introductions
    Replies: 7
    Last Post: 07-22-2008, 04:41 PM
  4. SecurityAudit
    By vinay in forum Visual Basic Programming
    Replies: 27
    Last Post: 01-07-2008, 12:14 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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