package Classes;

import java.util.Comparator;

public class Student implements Comparable<Student> {
    String name;
    int course;
    Boolean sex;

    public Student(String name, int course, Boolean gender) {
        this.name = name;
        this.course = course;
        this.sex = gender;
    }

    public void Print(){
        System.out.println("Name: " + name);
        System.out.println("Course: " + course);
        System.out.println("Sex: " + sex);
    }

    @Override
    public int compareTo(Student student) {
        int result;
        result = name.compareTo(student.name);
        if(result != 0) return result;
        result = Integer.compare(course, student.course);
        if(result != 0) return result;
        result = Boolean.compare(sex, student.sex);
        return result;
    }

}
