// // EOF-ctrl loop // Goal: count the # of words in the file data.txt? // import java.util.Scanner; class CountWords { public static void main(String[] args) { Scanner input = new Scanner(System.in); int count = 0; // setup the counter String data; // used to hold data while ( input.hasNext() ) { data = input.next(); count ++; } System.out.println("size = " + count); } }