X nested for loops <p>So, In my program I have a <code>List&lt;List&lt;String&gt;&gt;</code> of strings.</p> <p>For example:</p> <pre><code>List1: "Hi","Hello" List2: "Fred","Bob" List3: "how are you?","are you having a good day?","good weather, huh?" </code></pre> <p>could be the <code>List&lt;List&lt;String&gt;&gt;</code></p> <p>How can I generate a <code>List&lt;String&gt;</code> of all possible sentences?</p> <p>In this example, all sentences would be:</p> <pre><code>Hi Fred how are you? Hi Fred are you having a good day? Hi Fred good weather, huh? Hi Bob how are you? Hi Bob are you having a good day? Hi Bob good weather, huh? Hello Fred how are you? Hello Fred are you having a good day? Hello Fred good weather, huh? Hello Bob how are you? Hello Bob are you having a good day? Hello Bob good weather, huh? </code></pre>