title: Why am I getting could not find or load main class error?
body: <p>I am trying to run this piece of code</p>
  
  <pre><code>import java.io.*;
  
  class Palindrome{
      public static void main(String args[]) throws IOException
      {
          BufferedReader obj = new BufferedReader(new InputStreamReader(System.in));
          int n, temp, rev=0;
          System.out.print("Input a number--&gt; ");
          n = Integer.parseInt(obj.readLine());
          temp = n;
          while(temp != 0){
              rev = rev*10 + temp%10;
              temp /= 10;
          }
          if( n == temp)
              System.out.println(n + " is a palindrome.");
            else
               System.out.println(n + " is not a palindrome.");
      }
  }
  </code></pre>
  
  <p>I name the file palindrome.java.
  The file compiles easily using without showing any error</p>
  
  <pre><code>javac palindrome.java
  </code></pre>
  
  <p>but when I run</p>
  
  <pre><code>java Palindrome.class
  </code></pre>
  
  <p>It shows</p>
  
  <pre><code>Error: Could not find or load main class Palindrome.class
  </code></pre>
  
  <p>The result of <code>ls</code> in my working directory is:</p>
  
  <pre><code>Palindrome.class  palindrome.java
  </code></pre>