Assignemnt #50 and Compare To
Code
///Name: Daniel Rhees
///Period: 5
///Project Name: Compare To
///File Name: CompareTo.java
///Date: 1/14/2016
public class CompareTo
{
public static void main( String[]args )
{
String axe, dog, applebee's, apple;
System.out.print("Comparing \"axe\" with \"dog\" produces ");
int i = "axe".compareTo("dog");
System.out.println(i);
System.out.print("Comparing \"applebee's\" with \"apple\" produces ");
System.out.println( "applebee's".compareTo("apple") );
}
}
Picture of the output