import java.util.Arrays;
class Feb22 {
	public static void main(String[] args) {

	/*
	public int compareTo(E other)

		compareTo should return
		0 if this is equal to other
		a neg int if this is "less than" other
		a pos int if this is "greater than" other

	compareTo should satisfy the following properties:

	Give three instances of the class, x and y and z.

	x.compareTo(y) > 0 iff y.compareTo(x) < 0

	if x.compareTo(y) > 0 && y.compareTo(z) > 0 then
		x.compareTo(z) > 0
 
	if x.compareTo(y) == 0 
		then sgn(x.compareTo(z)) == sgn(y.compareTo(z))

	if x.compareTo(y) throws an exception, 
		so must y.compareTo(x)

	It is strongly recommended that for all x and y:
		if x.compareTo(y) == 0 
		then x.equals(y) returns true
	*/


	char A = 'A';
	char a = 'a';

	System.out.println(A - a);
	System.out.println(a - A);

	Character CA = Character.valueOf('A');
	Character Ca = Character.valueOf('a');
	
	System.out.println(CA.compareTo(Ca));
	System.out.println(Ca.compareTo(CA));

	String SA = "A";
	String Sa = "a";

	System.out.println(SA.compareTo(Sa));
	System.out.println(Sa.compareTo(SA));
	
	String DA = "A";
	System.out.println(SA.compareTo(DA));
	System.out.println(SA.equals(DA));
	System.out.println(SA == DA);
	
	/*
		lexicographical ordering on Strings

		if strings are equal then compareTo returns 0

		else if this.length() != other.length() then compareTo returns
		this.length() - other.length()

		else

			Let k be the smallest index in which 
			this.charAt(k) != other.charAt(k).

			Then compareTo() returns this.charAt(k) - other.charAt(k)
	*/

		Vehicle v1 = new Vehicle("A", 2000);
		Vehicle v2 = new Vehicle("B", 1000);
		Vehicle v3 = new Vehicle("C", 1500);

		Vehicle[] arr = { v1, v2, v3 };

		for(Vehicle v : arr) {
			System.out.println(v);
		} 
	
		Arrays.sort(arr);

		for(Vehicle v : arr) {
			System.out.println(v);
		} 


	 
	}
}










