java beans 的设计原则

1 公有的类

2 共有不带参数构造方法

3 私有属性

4 属性setter/getter方法

Studnet类:

package com.ddwei.student;

import java.util.Date;

public class Student {

// java beans 的设计原则  /**   * 1 公有的类 2 共有不带参数构造方法 3 私有属性 4 属性setter/getter方法   */

private int pid;// 学号  private String name;// 姓名  private String sex;// 性别  private Date birthday;// 出生日期  private String address;// 家庭地址

public Student() {

}

public Student(int pid, String name, String sex, Date birthday,    String address) {   // super();   this.pid = pid;   this.name = name;   this.sex = sex;   this.birthday = birthday;   this.address = address;  }

@Override  public String toString() {   return "Student [pid=" + pid + ", name=" + name + ", sex=" + sex     + ", birthday=" + birthday + ", address=" + address + "]";  }

public int getPid() {   return pid;  }

public void setPid(int pid) {   this.pid = pid;  }

public Date getBirthday() {   return birthday;  }

public void setBirthday(Date birthday) {   this.birthday = birthday;  }

public String getAddress() {   return address;  }

public void setAddress(String address) {   this.address = address;  }

public String getName() {   return name;  }

public void setName(String name) {   this.name = name;  }

public String getSex() {   return sex;  }

public void setSex(String sex) {   this.sex = sex;  }

}

最新文章

  1. PHP中explode和implode的区别
  2. ASP.NET MVC3中Controller与View之间的数据传递
  3. android-文件存储的使用
  4. android 发短信
  5. php + Redis 写的类似于新浪微博的feed系统
  6. 基于Extjs的web表单设计器 第四节——控件拖放
  7. nyoj 19擅长排列的小明 (DFS)
  8. LinkedIn高级分析师王益:大数据时代的理想主义和现实主义(图灵访谈)
  9. 功率和dB的关系
  10. windows nfs server for linux
  11. http层负载均衡之haproxy
  12. sqlclr创建表值函数案例
  13. iOS学习笔记(十六)——数据库操作(使用FMDB)
  14. java对象引用-要掌握的细节
  15. 自动生成材质Material(Unity3D开发之十九)
  16. Kali Linux中下载工具Axel的安装和使用
  17. Flutter去除右上角Debug标签
  18. PAT (Basic Level) Practise - 写出这个数
  19. WebGL 颜色与纹理
  20. JS浮点数运算

热门文章

  1. Stream接口
  2. 使用Openssl编译svn并安装
  3. 在命令行上启动genymotion虚拟机
  4. 32、Differential Gene Expression using RNA-Seq (Workflow)
  5. 从 .NET Framework到 .NET Core
  6. Libvirt代码架构
  7. Delphi Runtime Library在哪里?
  8. sqoop 安装与命令
  9. 2017-10-6 清北刷题冲刺班p.m
  10. CF622F The Sum of the k-th Powers(拉格朗日插值)