title: Problem with Java Scanner sc.nextLine();
body: <p>sry about my english :)<br>
  Im new to Java programming and i have a problem with Scanner. I need to read an Int, show some stuff and then read a string so i use <strong>sc.nextInt();</strong> show my stuff <strong>showMenu();</strong> and then try to read a string <strong>palabra=sc.nextLine();</strong></p>
  
  <p>Some one told me i need to use a sc.nextLine(); after sc.nextInt(); but i dont understand why do you have to do it :(</p>
  
  <p>Here is my code:</p>
  
  <pre><code>public static void main(String[] args) {
      // TODO code application logic here
      Scanner sc = new Scanner(System.in);
      int respuesta = 1;
  
      showMenu();
      respuesta = sc.nextInt();
      sc.nextLine(); //Why is this line necessary for second scan to work?
  
      switch (respuesta){
          case 1:
              System.out.println("=== Palindromo ===");
              String palabra = sc.nextLine();
              if (esPalindromo(palabra) == true)
                  System.out.println("Es Palindromo");
              else
                  System.out.println("No es Palindromo");
          break;
      }
  
  
  }
  </code></pre>
  
  <p>Ty so much for your time and Help :D</p>