title: Calling a method from within an if/if else statement
body: <p>Is it possible to call a method within an if statement, and then a separate method in an if else statement?</p>
  
  <p>I have created a scanner than reads keyboard input, and based on the option the user gives, a different method will be called. Can I say something along the lines of:</p>
  
  <pre><code>Scanner in = new Scanner (System.in);
  char choice = in.next().charAt(0);
  
  if(choice == 1)
  {
      private static void doAddStudent(Student aStudent) 
      {
          this.theRegistry.addStudent(aStudent);
      }
  }
  </code></pre>
  
  <p>any help would be much appreciated</p>