package com.lovecoding.day12.interface04_1;

public class TestCompable {


    public static void main(String[] args) {

        String a = "a";
        String b = "b";

        //String 实现 接口Compableable
        // a = 97 b = 98
        int i = a.compareTo(b);
        System.out.println(i);
        // 97 - 99 = -2
        System.out.println("a".compareTo("c"));
        // 99 - 97 = 2
        System.out.println("c".compareTo("a"));
        // 97-97 = 0
        System.out.println("a".compareTo("a"));

        //compareTo 比较两个对象 第一个大于第二个 正整数  > 0  相同 = 0  小于 < 0 进行排序
    }

}
