Program 50: comparingTo Challenge
///Name: Ilana Levy
///Period: 5
///Project Name: compareTo() Challenge
///File Name: compareChallenge.java
///Date Finished: 9/16/2015
public class compareChallenge
{
public static void main( String[] args)
{
System.out.println( "Comparing \"boy\" with \"girl\" produces " );
int i = "boy".compareTo("girl");
System.out.println( i);
System.out.println( "Comparing \"Jenny\" and \"Aaron\" produces " );
System.out.println( "Aaron".compareTo("Jenny"));
System.out.println( "Comparing \"book\" to \"worm\" produces " );
System.out.println( "book".compareTo( "worm" ));
System.out.println( "Comparing \"live\" to \"died\" produces " );
System.out.println( "live".compareTo( "died" ));
System.out.println( "Comparing \"repetitive\" to \"boring\" produces ");
System.out.println( "repetitive".compareTo("boring"));
System.out.println( "Comparing \"las\" to \"Lomas\" produces " );
System.out.println( "las".compareTo("Lomas" ));
System.out.println( "Comparing \"a\" and \"b\" produces " );
System.out.println( "a".compareTo("b"));
System.out.println( "Comparing \"dog\" to \"dud\" produces " );
System.out.println( "dog".compareTo("god" ));
System.out.println( "Comparing \"challenge\" to \"obstacle\" produces ");
System.out.println( "challenge".compareTo("obstacle" ));
System.out.println( "Comparing \"Harvard\" to \"Stanford\" produces " );
System.out.println( "Harvard".compareTo("Stanford" ));
System.out.println( "Comparing \"trench\" to \"military\" produces ");
System.out.println( "trench".compareTo("military"));
System.out.println( "Comparing \"employer\" and \"employee\" produces " );
System.out.println( "employer".compareTo("employee"));
}
}