Created
October 25, 2015 08:47
-
-
Save masa25michi/989ace9d0937ac3fe3ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage of basic Scanner for read file