title: How to generate a random String in Java
body: <p>I have an object called <code>Student</code>, and it has <code>studentName</code>, <code>studentId</code>, <code>studentAddress</code>, etc. For the <code>studentId</code>, I have to generate random string consist of seven numeric charaters,
  eg.</p>
  
  <pre><code>studentId = getRandomId();
  studentId = "1234567" &lt;-- from the random generator.
  </code></pre>
  
  <p>And I have to make sure that there is no duplicate id.</p>