package com.sf.day13;



public class Student implements  Comparable{
    // 名字
    private String name;
    //分数
    private int score;


    public Student() {
    }

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

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

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

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

    @Override
    public int compareTo(Object obj) {
        Student stu = null;
        int i;
        if(obj  instanceof   Student){
             stu = (Student) obj;
             i = this.score - stu.score;
            return  i;
        }
        return  99;
    }
}
