title: Illegal start of type in while loop
body: <p>I just started programming in java for school.(I already coded in Python and HTML/CSS.) I don't have much time and kind of doing it in a hurry. I don't understand everything that I am doing and every explication would be appreciated. I didn't really get the static and the public thing. Anyway, my main problem at the moment is that I got many errors on my while loop. Could you please help me fix this? Thank you. Here's my code and errors.</p>
  
  <pre><code>import java.util.scanner;
  
  public class happy_tree {
      public static class constants{
      public static final string draw_char = "|";
      public static final int max_height = 40;
      public static final int min_height = 5;
      }
      public static void main(String[] args) {
          tree_height = get_user_input();
      }
      public static class get_user_input{
          Scanner reader = new Scanner(System.in);
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
              System.out.println("Veuillez entrer la hauteur du sapin à dessiner: ");
              tree_height = reader.nextInt();
              if (!reader.hasNextInt()){
                  System.out.println("Veuillez entrer un nombre entier.");
              }else if (tree_height&gt;max_height){
                  System.out.println("Veuillez entrer une valeur entre 5 et 40.");
              }else if (tree_height&lt;min_height){
                  System.out.println("Veuillez entrer une valeur entre 5 et 40.");
              }
          }
          return int tree_height;
      }
  }
  </code></pre>
  
  <p>And the errors: </p>
  
  <pre><code>Main.java:14: error: illegal start of type
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
          ^
  Main.java:14: error: illegal start of type
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
                 ^
  Main.java:14: error: ')' expected
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
                  ^
  Main.java:14: error: ';' expected
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
                        ^
  Main.java:14: error: invalid method declaration; return type required
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
                         ^
  Main.java:14: error: ';' expected
          while (!reader.hasNextInt() &amp;&amp; !tree_height&lt;=max_height &amp;&amp; tree_height&gt;=min_height) {
                                     ^
  Main.java:25: error: illegal start of type
          return int tree_height;
          ^
  Main.java:25: error: ';' expected
          return int tree_height;
                ^
  Main.java:25: error: &lt;identifier&gt; expected
          return int tree_height;
  </code></pre>