15 lines
385 B
Java
Executable File
15 lines
385 B
Java
Executable File
import java.io.*;
|
|
import java.util.*;
|
|
|
|
public class countWords {
|
|
public static void main(String[] args) throws FileNotFoundException {
|
|
Scanner fileScanner = new Scanner(new File(args[0]));
|
|
int count = 0;
|
|
while (fileScanner.hasNext()) {
|
|
count++;
|
|
String dummy = fileScanner.next();
|
|
}
|
|
System.out.println(count);
|
|
}
|
|
}
|