Java: How to print corresponding alphabets till a number entered by user?
<p>I'm a beginner in Java and I'm trying to find out how to create a segment of code that can allow a user to enter a number between 1 and 26, and have the corresponding number of sequential letters to appear? </p>

<p>For example, if the user enters 3 then the computer would output a, b, c</p>

<p>Thank you in advance. </p>

<p>Update:
I wrote the following code but there is an error message stating that the i in the integer conversion part is a duplicate of a local variable? </p>

<p>In another method, the user inputs the number between 1 and 26 and I'm reading that input as the String variable "num".</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>public String getChar (int i){
  String num;  
  String text = mini1Num.getText();
  
  Integer i = Integer.valueOf(text);

  return i &gt; 0 &amp;&amp; i &lt; 27 ? String.valueOf((char)(i + 'A' - 1)) : null;


 }</code></pre>
</div>
</div>

What am I doing wrong?</p>