Skip to content

Instantly share code, notes, and snippets.

@masa25michi
Created October 25, 2015 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masa25michi/989ace9d0937ac3fe3ae to your computer and use it in GitHub Desktop.
Save masa25michi/989ace9d0937ac3fe3ae to your computer and use it in GitHub Desktop.
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
public class t2 {
public static void main(String [] args) throws IOException
{
Scanner scanner = new Scanner(new File("t2.txt"));
//int [] array = new int [100];
ArrayList array = new ArrayList();
int i = 0;
while(scanner.hasNextInt()){
array.add(scanner.nextInt());
}
System.out.println(array.toString());
}
}
@masa25michi
Copy link
Author

Usage of basic Scanner for read file

@fungnoth
Copy link

Hi I'm Cyril

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment