标签:style io ar 使用 sp on bs new size
public class Employee {
    private String  firstName;
    private String lastName;
    public Employee() {
    } ;  
    
     public String getFirstName() {
        return firstName;
    }
     public void setFirstName(String firstName) {
         this.firstName=firstName;
     }
     public String getLastName() {
        return lastName;
    }
     public void setLastName(String lastName){
         this.lastName=lastName;
     }
     private Date hireDate;
     public Date getHireDate(){
         return hireDate;
     }
     public void setHireDate(Date hireDate){
         this.hireDate=hireDate;
     }
     private boolean manager;
     public boolean isManager(){
         return manager;
     }
     public void setManager(boolean manager){
         this.manager=manager;
     }
     public String getFullName(){
         return lastName+firstName;
     }
}
public static void main(String[] args) throws Exception{
        Employee employee=new Employee();
        PropertyUtils.setSimpleProperty(employee, "firstName", "李");
        PropertyUtils.setSimpleProperty(employee, "lastName", "旭丹");
        System.out.println(PropertyUtils.getSimpleProperty(employee, "firstName")+"-"+PropertyUtils.getSimpleProperty(employee, "lastName"));
    }
beanutils通过SimpleProperty使用get或set方法赋值
标签:style io ar 使用 sp on bs new size
原文地址:http://www.cnblogs.com/danmao/p/4052647.html