• Java小项目之:校园注册登录系统!


    Java小项目之:校园注册登录系统!

    相信很多学校都有自己的网站,而且还有学生课表成绩查询的系统,和教师端的操作系统。今天教大家做一个简单的注册登录系统!

    代码展示:

    package com.entity;

    public class Teacher {

    private int id;

    private String name;

    private String sex;

    private int age;

    public Teacher(){

    super();

    }

    public Teacher(int id, String name) {

    super();

    this.id = id;

    this.name = name;

    }

    public Teacher(int id, String name, String sex, int age) {

    super();

    this.id = id;

    this.name = name;

    this.sex = sex;

    this.age = age;

    }

    public int getId() {

    return id;

    }

    public void setId(int id) {

    this.id = id;

    }

    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;

    }

    public int getAge() {

    return age;

    }

    public void setAge(int age) {

    this.age = age;

    }

    public String toString() {

    return "教师 工号:" + id + " 姓名:" + name + " 性别:" + sex

    + " 年龄:" + age;

    }

    public int hashCode() {

    return id;

    }

    public boolean equals(Object obj) {

    if (this == obj)

    return true;

    if (obj == null)

    return false;

    if(obj instanceof Teacher){

    Teacher other=(Teacher)obj;

    return id==other.id&&name.equals(other.name);

    }

    return false;

    }

    }

    喜欢这样文章的可以关注我,我会持续更新,你们的关注是我更新的动力!需要更多java学习资料的也可以私信我!

    祝关注我的人都:身体健康,财源广进,福如东海,寿比南山,早生贵子,从不掉发!

  • 相关阅读:
    jquery ajax全解析
    java 远程调试 remote java application
    w3c html dom
    ngx_php
    websocket+前后端分离+https的nginx配置
    CentOS6下基于Nginx搭建mp4/flv流媒体服务器
    nginx could not build the server_names_hash 解决方法
    Nginx 实现AJAX跨域请求
    Nginx与Apache的Rewrite规则的区别
    nginx支持pathinfo模式
  • 原文地址:https://www.cnblogs.com/heqingxiaohuo/p/12283997.html
Copyright © 2020-2023  润新知