Implementing a word-chain checker This is web exercise 3.1.45. from the book Computer Science An Interdisciplinary Approach by Sedgewick &amp; Wayne:

Write a program that reads in a list of words from the command line
and prints true if they form a word chain and false otherwise. In a
word chain, adjacent words must differ in exactly one letter, e.g.,
HEAL, HEAD, DEAD, DEED, DEER, BEER.

Here is my program:
public class WordChainChecker 
{
    public static boolean checkWordCouple(String word1, String word2)
    {
        int counter = 0;
        int wordLength = word1.length();
        for (int i = 0; i &lt; wordLength; i++)
        {
            if (word1.charAt(i) != word2.charAt(i)) counter++;
        }
        if (counter &gt; 1) return false;
        else             return true;
    }
    public static void main(String[] args)
    {
        String word1 = StdIn.readString();
        String word2 = StdIn.readString();
        boolean truth = true &amp;&amp; checkWordCouple(word1,word2);
        while (!StdIn.isEmpty())
        {
            word1 = StdIn.readString();
            truth = truth &amp;&amp; checkWordCouple(word1,word2);
            word2 = word1; 
        }
        System.out.println(truth);
    }
}

StdIn is a simple API written by the authors of the book. I checked my program and it works.
Is there any way that I can improve my program?
Thanks for your attention.
Requirements
Number of words
Are you guaranteed to have at least 2 words?  If so, you could simplify your loop, by removing the first read; the loop will take care of the second &amp; subsequent words:
    String word2 = StdIn.readString();
    boolean truth = true;
    while (!StdIn.isEmpty())
    {
        String word1 = StdIn.readString();
        truth = truth &amp;&amp; checkWordCouple(word1,word2);
        word2 = word1; 
    }

Although now if given a single word, it will produce true.  This may be an improvement, but you’d need to check the exact requirements to be sure.
Word Length
Is HEAD, HEAL, TEA, TO a word chain?  Your program says it is!
What about HEAD, HEAL, HEALTHY?  That input causes your program to crash!
Your program should handle mismatched word length, unless the problem statement guarantees all inputs will be the same length.
Number of Differences
The problem description says:

In a word chain, adjacent words must differ in exactly one letter

but HEAD, HEAD, HEAD, HEAD is reported as &quot;true&quot;.  Clearly, counter &gt; 1 is not the correct &quot;false&quot; condition.  Borrowing Doi9t's suggestion, and further improving it, the correct line would read:
return counter == 1;

Self Documenting Code
You read word1, then word2, and compare the first to the second (let’s call that “forward”), then read a third into word1, and compare the third to the second (comparison in the “reverse” direction).  You are testing for one difference, so it works, but what if you were checking for one additional character?  By reversing the word order, you’d actually be testing for character removal!
Instead of word1 &amp; word2, maybe previous_word and next_word would help keep things clearer.
    String previous_word = StdIn.readString();
    boolean truth = true;
    while (!StdIn.isEmpty())
    {
        String next_word = StdIn.readString();
        truth = truth &amp;&amp; checkWordCouple(previous_word, next_word);
        previous_word = next_word; 
    }