package com.sf.day05.practice;


/**
 * 这是小猫和老鼠的父类
 */
public class Animal {

    private String name;
    private Integer id;


    public void shut(){
        System.out.println("小动物叫！！！");
    }

    public Animal() {
    }

    public Animal(String name, Integer id) {
        this.name = name;
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }


    @Override
    public String toString() {
        return "Animal{" +
                "name='" + name + '\'' +
                ", id=" + id +
                '}';
    }

    public void eat(){
        System.out.println("小动物正在吃饭");
    }

    public void sleep(){
        System.out.println("小动物正在休息");
    }

    public void showMySelfInfoP(){
        System.out.println("我是id为"+id+"号，名字为"+name+"的可爱小动物！！！");
    }
}
