title: How to generate an incremental alphanumeric ID in java?(String ID)
body: <p>I have a method for example, </p>
  
  <pre><code>public Order newOrder(Product prod, Supplier supp)
  </code></pre>
  
  <p>and need to generate an unique alphanumeric code with the format "ordn", where 'n' is a progressive number starting from 1, so every time a new order is added the ID will increment to "ord2" "ord3"...  </p>
  
  <p>How can I do this? Is it possible to do it by substringing?</p>
  
  <p>I know how to generate an integer ID, but <strong>this one is a String</strong>, so my problem is more like how to increment an integer number in a string.</p>
  
  <p>I tried to substring it to <code>String ocode = "ord" + n</code>, and just increment "n", but how can I assign this whole thing to the new order? or do I need a loop?
  (the code has to be a String I guess, later there is a findOrder() method to retrieve a specific order by accepting the String code. &lt;--not sure if it matters.)</p>
  
  <p>btw I'm new to Java, and this is just a part of an exercise.</p>
  
  <hr>
  
  <p>Solved, turns out the substring works...</p>