当前位置 : 主页 > 编程语言 > c++ >

构造方法中数据库表中的运用

来源:互联网 收集:自由互联 发布时间:2021-07-03
gistfile1.txt package test1;class Emp{private int empno;private String ename;private String job;private double sal;private double comm;public Emp() {super();// TODO Auto-generated constructor stub}public Emp(int empno, String ename, String
gistfile1.txt
package test1;


class Emp{
	private int empno;
	private String ename;
	private String job;
	private double sal;
	private double comm;
	public Emp() {
		super();
		// TODO Auto-generated constructor stub
	}
	public Emp(int empno, String ename, String job, double sal, double comm) {
		super();
		this.empno = empno;
		this.ename = ename;
		this.job = job;
		this.sal = sal;
		this.comm = comm;
	}
	public int getEmpno() {
		return empno;
	}
	public void setEmpno(int empno) {
		this.empno = empno;
	}
	public String getEname() {
		return ename;
	}
	public void setEname(String ename) {
		this.ename = ename;
	}
	public String getJob() {
		return job;
	}
	public void setJob(String job) {
		this.job = job;
	}
	public double getSal() {
		return sal;
	}
	public void setSal(double sal) {
		this.sal = sal;
	}
	public double getComm() {
		return comm;
	}
	public void setComm(double comm) {
		this.comm = comm;
	}
	public void getinfo(){
		System.out.println("编号" + this.getEmpno() 
					+ "姓名" + this.getEname()
					+ "职位" + this.getJob()
					+ "工资" + this.getSal()
					+ "奖金" + this.getComm());
	}
}
public class Emp1 {

	public static void main(String[] args) {
		Emp e = new Emp(12,"zhuo","zhiwe",100,2000);
		e.getinfo();
	}

}
网友评论