JAVA CMD
JAVA CMD
This program counts the number of words in a given input string passed as a
command-line argument.
public class CountWords {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Please provide a string within quotes.");
return;
}