According to what you said,I modified the method.
---------------------------following error code---------------------
int age;
public void setAge(int person_age){ ///must use the string type param,
                                        ///otherwise error occurs
    age=person_age;
}
public int getAge(){  ///can't reutrn Int,otherwise error occurs
    return age;
}
-----------------------------end--------- -------------------------
 
The exception was still throwed  out unless I write code as following:
 
int age;
public pervoid setAge(String son_age){ ///must use the string type param,
                                        ///otherwise error occurs
    age=Integer.parseInt(person_age);
}
public String getAge(){  ///can't reutrn Int,otherwise error occurs
    return String.valueOf(age);
}
------------------------------------------------------------------
 
Why?Why?Why?Why?Why?Why?Why?Why?Why?Why?
 
Bea Weblogic6.1 sp1
J2SDK1.4
Win2K
Sent: Saturday, July 27, 2002 5:27 PM
Subject: Re: int type property in javaBean

Hi kongtao,
                      U have to write setAge(int person_age) because javabean functionality requires set and get of same datatype when it is deployed.
 
With Regards,
eSWAR.

Reply via email to