定义了一个javaBean
public class StudentBean {
private String name;
private int age;
private Boolean lb;
private double fen;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Boolean getLb() {
return lb;
}
public void setLb(Boolean lb) {
this.lb = lb;
}
public double getFen() {
return fen;
}
public void setFen(double fen) {
this.fen = fen;
}
}
public class studentBeanTest {
public static void main(String[] args){
//javaBean数据存放到Map集合中。 Map<String, String> map1=new HashMap<String, String>(); map1=BeanUtils.describe(student); Set<Entry<String, String>> entry =map1.entrySet(); for (Entry<String, String> entry2 : entry) { System.out.println(entry2.getKey()); System.out.println(entry2.getValue()); } }}//将javaBean数据存放到Map集合后,迭代打印map1集合里的数据,会多出来一个(class-----class com.tsh.text.StudentBean)键值对信息?这个有什么用?
|