码迷,mamicode.com
首页 > 其他好文 > 详细

实体类pojo

时间:2021-03-09 13:28:17      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:override   pack   ext   int   rri   ack   private   ret   ring   

实体类pojo

package com.kuang.pojo;

//实体类: 我们一般是和数据库中的表结构一一对应的
public class People {
    private int id;
    private String name;
    private int age;
    private String address;

    public People() {
    }

    public People(int id, String name, int age, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.address = address;
    }

    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 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;
    }

    @Override
    public String toString() {
        return "People{" +
                "id=" + id +
                ", name=‘" + name + ‘\‘‘ +
                ", age=" + age +
                ", address=‘" + address + ‘\‘‘ +
                ‘}‘;
    }


}

 

实体类pojo

标签:override   pack   ext   int   rri   ack   private   ret   ring   

原文地址:https://www.cnblogs.com/tomcat985/p/14496934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!