You might want to do something like this (if you’re in java 5 & up)
Scanner scanner = new Scanner(new File("tall.txt"));
int [] tall = new int [100];
int i = 0;
while(scanner.hasNextInt()){
tall[i++] = scanner.nextInt();
}
More Related Contents:
- Fairly new to programming, trouble reading and writing to a binary file. [closed]
- byte[] to file in Java
- Why Java Only Allows String[] args as Main method Argument? [duplicate]
- Type mismatch: cannot convert from double to double[]
- I have a function in java which may have bug and I can not find it [closed]
- How do I reverse an int array in Java?
- Arrays.asList() not working as it should?
- How to convert jsonString to JSONObject in Java
- How do I remove objects from an array in Java?
- Array or List in Java. Which is faster?
- A quick and easy way to join array elements with a separator (the opposite of split) in Java [duplicate]
- How to convert an ArrayList containing Integers to primitive int array?
- How to supply value to an annotation from a Constant java
- What is this: [Ljava.lang.Object;?
- Creating an array of objects in Java
- Quickest way to find missing number in an array of numbers
- Lambda expression to convert array/List of String to array/List of Integers
- Using GSON to parse a JSON array
- Byte Array to Image object
- String array initialization in Java [duplicate]
- Read .txt file into 2D Array
- How are arrays implemented in java?
- Easiest way to convert a Blob into a byte array
- Explanation on Integer.MAX_VALUE and Integer.MIN_VALUE to find min and max value in an array
- Given a Java InputStream, how can I determine the current offset in the stream?
- java file input with rewind()/reset() capability
- Printing out a 2D array in matrix format
- Array of function pointers in Java [duplicate]
- How to convert a Java String to an ASCII byte array?
- Converting an int array to a String array