title: java.lang.NumberFormatException: For input string: "firstno"
body: <p>I am trying to run one program. I am really very newbie on java. When i run my program i am getting following exception..   </p>
  
  <pre><code>type Exception report
  message For input string: "firstno"
  
  description The server encountered an internal error that prevented it from fulfilling his request.
  exception
  
  java.lang.NumberFormatException: For input string: "firstno"
  java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  java.lang.Integer.parseInt(Integer.java:492)
  java.lang.Integer.parseInt(Integer.java:527)
  MathEx.doPost(MathEx.java:34)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)    
  </code></pre>
  
  <p>Here is my code for your reference.   </p>
  
  <pre><code>import java.sql.*;
  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;
  
  public class MathEx extends HttpServlet
  {
  public void doGet(HttpServletRequest p, HttpServletResponse q) throws ServletException, IOException
    {
      q.setContentType("Text/HTML");
      PrintWriter out = q.getWriter();
  
      out.println("&lt;form method=post&gt;");
      out.println("Enter first number");
      out.println("&lt;input type=text name=first&gt;");
      out.println("&lt;br&gt;&lt;br&gt;");
      out.println("Enter second no.");
      out.println("&lt;input type=text name=second&gt;");
      out.println("&lt;br&gt;&lt;br&gt;");
      out.println("&lt;input type=submit name=send value=ADDITION&gt;");
      out.println("&lt;input type=submit name=send value=SUBSTRACTION&gt;");
  
      out.println("&lt;input type=submit name=send value=END&gt;");
      out.println("&lt;/form&gt;");
     }
  
   public void doPost(HttpServletRequest s, HttpServletResponse t) throws ServletException, IOException
       {
        t.setContentType("TEXT/HTML");
        PrintWriter out=t.getWriter();
        String firstno = s.getParameter("first");
        String secondno = s.getParameter("Second"); 
        String choice = s.getParameter("send");
        int fno=Integer.parseInt("firstno");
        int sno=Integer.parseInt("secondno");
        int result;
        out.println("First no ="+fno);
        out.println("&lt;br&gt;&lt;br&gt;");
        out.println("Second no ="+sno);
        out.println("&lt;br&gt;&lt;br&gt;");
  
   if (choice.equals("ADDITION"))
   {
    result=fno+sno;
    out.println("The result of addition= "+result);
   }
  
  
   if (choice.equals("SUBSTRACTION"))
   {
     result=fno-sno; 
     out.println("The result of substraction= "+result);
   }
  
  
   if (choice.equals("END"))
   {
    out.println("Thank you have a nice day");
    return;
   }
  
  
    out.println("&lt;br&gt;&lt;br&gt;&lt;br&gt;");
    doGet(s,t);
   {
     out.println("&lt;br&gt;&lt;br&gt;&lt;br&gt;");
     out.println("bye  bye");
   }
  
  }
  </code></pre>
  
  <p>}   </p>
  
  <p>I really don't understand why happening this.. Please give me any reference or hint.  </p>