Assignment and random
<p>I am trying to write a method that repeatedly flips a coin until three heads in a row are seen.  Each time the coin is flipped, what is seen is displayed (H for heads, T for tails). When 3 heads in a row are flipped a congratulatory message is printed. 
eg.T T T H T H H H
Three heads in a row!</p>

<pre><code>public static void threeHeads(){
  Random rnd=new Random();
    char c = (char) (rnd.nextInt(26) + 'a');
    for(int i=1;i&lt;=c.
}
</code></pre>

<p>I am stuck inside for loops.How should i specify the number of times it will loop.Even if i declare 3 different char c,how can i convert it to the number of times to loop.I was thinking if i should find the ascii table to find which number is H and T to print these 2 out specially?Or a loop is redundant?</p>

<pre><code>public static void threeHeads(){
  Random rnd=new Random();
    char c = (char) (rnd.nextInt(26) + 'a');
    if(c=='H' &amp;&amp; c=='H' &amp;&amp; c=='H'){
        System.out.println("Three heads in a row!");
    }
}
</code></pre>

<p>Another problem is assignment which is == and equals.
For a boolean value,i use ==
I understand that for strings,i should use equal.Then for a char character,what should i use?
eg.char=='y'<br>
Am i right?</p>
