|
||||||
| Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
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();
}
}
![]()
__________________
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help! Rlink32 Error | Sparky | Pascal/Delphi | 6 | 10-16-2008 10:31 AM |
| How to add My program to Startup ? | kresh7 | Visual Basic Programming | 49 | 09-14-2008 11:13 AM |
| First post from long time Ccal lurker | James Argo | Introductions | 7 | 07-22-2008 04:41 PM |
| SecurityAudit | vinay | Visual Basic Programming | 27 | 01-07-2008 12:14 PM |
Algorithms and Data Structures
Programming Language Popularity
Code Collaboration
Podnet IRC Network
AmpHosted
Goal #1: 1,000 Blogs
Goal #2: 1,000 Wiki Pages
Goal #3: 300,000 Posts
Goal #4: 20,000 Threads
Done: 30%, 23%, 55%, 75%