// Purpose: Display the length of a user-specified word import java.util.*; public class WordLength { // main(): application entry point public static void main(String[] args) { // set input stream Scanner stdin = new Scanner(System.in); // get desired word System.out.print("Enter a word: "); String word = stdin.nextLine(); // compute length of word int wordLength = word.length(); // display result System.out.println("Word " + word + " has length " + wordLength + "."); } }