Hi,

Please check out the code below...

import java.util.*;

 public class test_tbe
 {
   private String name=null,email=null;
     // If the set method takes a String, this must be a String.
   private String age;
   private int internal_age;

   public test_tbe()
   {
   }

   public String getName()
   {
         return email;
   }

   public int getAge()
   {
         return String.valueOf(internal_age);
   }

   public void setName(String p_name)
   {
     name = new String(p_name);
   }

   public void setEmail(String p_email)
   {
         email = new String(p_email);
   }

   public void setAge(String p_age)
   {
     // Guess you are not using this if it is not a number.
     age = p_age;
     try {
     internal_age = Integer.parseInt(p_age);
         }
     catch(Exception e)
     {
         internal_age=24; // by default
     }
   }

 }

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to