Java模拟银行业务系统

package com.xu_six;

import java.io.Serializable;

/**
 * 用户类
 * @author XuSir
 *2021年3月27日上午10:01:16
 */
public class User implements Serializable{
   
/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
//	用户的属性;必须私有化
	private String userName;	//用户名
	private String userId;		//用户身份ID
	private String sex;			//性别
	private int age;			//年龄
	private String address;		//居住地址
	private String account;		//银行账号
	private String tel;			//预留电话
	private String passWord;	//取款密码
	private double banlance;	//账户余额
	
//	提供外界获取属性的方法
	public String getUserName() {
   
		return userName;
	}
	public void setUserName(String userName) {
   
		this.userName = userName;
	}
	public String getUserId() {
   
		return userId;
	}
	public void setUserId(String userId) {
   
		this.userId = userId;
	}
	public String getSex() {
   
		return sex;
	}
	public void setSex(String sex) {
   
		this.sex = sex;
	}
	public int getAge() {
   
		return age;
	}
	public void setAge(int age) {
   
		this.age = age;
	}
	public String getAddress() {
   
		return address;
	}
	public void setAddress(String address) {
   
		this.address = address;
	}
	public String getAccount() {
   
		return account;
	}
	public void setAccount(String account) {
   
		this.account = account;
	}
	public String getTel() {
   
		return tel;
	}
	public void setTel(String tel) {
   
		this.tel = tel;
	}
	public String getPassWord() {
   
		return passWord;
	}
	public void setPassWord(String passWord) {
   
		this.passWord = passWord;
	}
	public double getBanlance() {
   
		return banlance;
	}
	public void setBanlance(double banlance) {
   
		this.banlance = banlance;
	}
	
public User() {
   
	// TODO Auto-generated constructor stub
}
public User(String userName, String userId, String sex,int age, String address,
		 String account, String tel,String passWord, double banlance) {
   
		
	super();
	this.userName = userName;
	this.userId = userId;
	this.sex = sex;
	this.age = age;
	this.address = address;
	this.account = account;
	this.tel = tel;
	this.passWord = passWord;
	this.banlance = banlance;
}
@Override
public int hashCode() {
   
	final int prime = 31;
	int result = 1;
	result = prime * result + ((account == null) ? 0 : account.hashCode());
	result = prime * result + ((userId == null) ? 0 : userId.hashCode());
	result = prime * result + ((userName == null) ? 0 : userName.hashCode());
	return result;
}
@Override
public boolean equals(Object obj) {
   
	if (this == obj)
		return true;
	if (obj == null)
		return false;
	if (getClass() != obj.getClass())
		return false;
	User other = (User) obj;
	if (account == null) {
   
		if (other.account != null)
			return false;
	} else if (!account.equals(other.account))
		return false;
	if (userId == null) {
   
		if (other.userId != null)
			return false;
	} else if (!userId.equals(other.userId))
		return false;
	if (userName == null) {
   
		if (other.userName != null)
			return false;
	} else if (!userName.equals(other.userName))
		return
  • 2
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值