title: How to generate a random string in Java program
body: <p>Here is my attempted code for this homework problem:</p>
  
  <p>Write a method called randomLines that prints between 5 and 10 random strings of letters (between "a" and "z"), one per line. Each string should have random length of up to 80 characters.</p>
  
  <p>public static void randomLines () {</p>
  
  <pre><code>Random rand = new Random();
  
  
  for (int i = 1; i&lt;=rand.nextInt(6)+5; i++) {
  
      for(int j = 1; j &lt;= rand.nextInt(25)+97; j++){
  
  
             System.out.print(s.charAt(r.nextInt(N)));           
             System.out.println((char) rand.nextInt(25)+97);
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Here is my only question:</p>
  
  <p>How can I get a random Character to print here:</p>
  
  <pre><code>System.out.println((char) rand.nextInt(25)+97); &lt;&lt; prints random integers not characters
  </code></pre>
  
  <p>My logic is this: ASCII characters for that range are between 97-122 (a-z).</p>
  
  <p>Thank you for your help.</p>