Wierd String error, please be gracious, new to java
<p>So my problem is that it keeps saying I already defined <code>String spaces</code> up top but if I take the definition that's outside of the loop away and try to define <code>spaces</code> only in the loop, it tells me it hasn't been instantiated...</p>

<pre><code>public class NestedLoop {
 public static void main (String [] args) {

  int userNum  = 0;
  int i = 0;
  int j = 1;
  String spaces = "";
  Scanner scnr = new Scanner(System.in);

  System.out.print("Enter userNum:");
  userNum = scnr.nextInt();

   for (i = 0; i &lt;= userNum; i++)   {
     while (j == i){
        spaces = spaces.concat(" ");
        System.out.print(spaces);
        j++;}
        System.out.println(i);}
</code></pre>

<p>Error: main.java:244: spaces is already defined in main(java.lang.String[])</p>