//
package stringio;
import java.util.Scanner;
import java.io.*;
public class Stringio {
public static void main(String[] args) throws IOException
{
File loopfile = new File("fileLoop.txt");
Scanner getAll = new Scanner( loopfile ); // connect a Scanner to the file
String num;
String[] items = new String[10];
int i = 0;
while(getAll.hasNextLine()){
num = getAll.nextLine();
// square = num * num ;
//System.out.println("The square of " + num + " is " + square);
items[i] = num;
System.out.println("items[i] is " + items[i]);
i = i + 1;
}
getAll.close();
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here