/* * SelectorDemo - demonstrates the Selector class and the * Testable interface. */ public class SelectorDemo { public static void main( String[ ] args ) { int result1 = SelectorInt.min( 23, 12, 74 ); System.out.println( "Position of Min: " + result1 ); MyInteger x1 = new MyInteger( 23 ); MyInteger x2 = new MyInteger( 12 ); MyInteger x3 = new MyInteger( 74 ); System.out.println( "x1 = " + x1 + "\n" + "x2 = " + x2 + "\n" + "x3 = " + x3 ); int result2 = Selector.min( x1, x2, x3 ); System.out.println( "Position of Min: " + result2 ); MyString s1 = new MyString( "Bob" ); MyString s2 = new MyString( "Carol" ); MyString s3 = new MyString( "Alice" ); System.out.println( "s1 = " + s1 + "\n" + "s2 = " + s2 + "\n" + "s3 = " + s3 ); int result3 = Selector.min( s1, s2, s3 ); System.out.println( "Position of Min: " + result3 ); } }