Assignemnt #46 Comepare 2 Challenge

Code

    ///Name: JJ Deng
    ///Period: 6
    ///Program Name: CompareTo() Challenge
    ///File Name: Compare2Challenge.java
    ///Date Finished: 11/30/15
    
    public class Compare2Challenge
    {
        public static void main(String[] args)
        {
            
            System.out.print( "Comparing 'apple' to 'banana' produces " );
            System.out.println( "apple".compareTo("banana"));
            System.out.println( "" );
            System.out.print( "Comparing 'banana' to 'juice' produces " );
            System.out.println( "banana".compareTo("juice"));
            System.out.println( "" );
            System.out.print( "Comparing 'cooking' to 'eating' produces " );
            System.out.println( "cooking".compareTo("eating"));
            System.out.println( "" );
            System.out.print( "Comparing 'internet' to 'zebra' produces " );
            System.out.println( "internet".compareTo("zebra"));
            System.out.println( "" );
            System.out.print( "Comparing 'detergent' to 'salt' produces " );
            System.out.println( "detergent".compareTo("salt"));
            System.out.println( "" );
            System.out.print( "Comparing 'halo' to 'circle' produces " );
            System.out.println( "halo".compareTo("circle"));
            System.out.println( "" );
            System.out.print( "Comparing 'sun' to 'moon' produces " );
            System.out.println( "sun".compareTo("moon"));
            System.out.println( "" );
            System.out.print( "Comparing 'yolo' to 'swag' produces " );
            System.out.println( "yolo".compareTo("swag"));
            System.out.println( "" );
            System.out.print( "Comparing 'you' to 'me' produces " );
            System.out.println( "you".compareTo("me"));
            System.out.println( "" );
            System.out.print( "Comparing 'tomorrow' to 'today' produces " );
            System.out.println( "tomorrow".compareTo("today"));
            System.out.println( "" );
            System.out.print( "Comparing 'year' to 'month' produces " );
            System.out.println( "year".compareTo("month"));
            System.out.println( "" );
            System.out.print( "Comparing 'me' to 'me' produces " );
            System.out.println( "me".compareTo("me"));
            System.out.println( "" );
            System.out.print( "Comparing 'you' to 'you' produces " );
            System.out.println( "you".compareTo("you"));
            
        
            
        }
    }
     

Picture of the output

Assignment 43