title: Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Scanner.java:862)
body: <p>I really don't see what the problem could be. This is the error I'm getting:</p>
  
  <p><code>    $javac Palindrome.java
      $java -Xmx128M -Xms16M Palindrome
      Enter your word
      Exception in thread "main" java.util.NoSuchElementException
      at java.util.Scanner.throwFor(Scanner.java:862)
      at java.util.Scanner.next(Scanner.java:1485)
      at java.util.Scanner.nextInt(Scanner.java:2117)
      at java.util.Scanner.nextInt(Scanner.java:2076)
      at Palindrome.main(Palindrome.java:28)
  </code></p>
  
  <p>This is the code: </p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  import java.util.*;
  import java.lang.StringBuffer;
  // Java program to illustrate checking of a string
  // if its palindrome or not using reverse function
  public class Palindrome
  {
  public static void checkPalindrome(String s)
  {
  // reverse the given String
      String reverse = new StringBuffer(s).reverse().toString();
  // check whether the string is palindrome or not
  if (s.equals(reverse))
  System.out.println("Yes");
  else
  System.out.println("No");
  }
  public static void main (String[] args) throws java.lang.Exception
  {
  Scanner scanner = new Scanner(System.in);
  System.out.println("Enter your word");
  String output = scanner.next();
  }
  }
  </code></pre>
  
  <p>I ask for the word and then get the input to check if it is a palindrome</p>