3 public String toString() {
9 public class TertiaryTest {
10 static public void main( String[] args ) {
12 int y = x<5 ? 6 : 1000;
13 int z = x>1 ? y>7 ? 2000 : 8 : 3000;
14 System.out.println( "x should be 3: "+x );
15 System.out.print ( "y should be 6: "+y+"\n" );
16 System.out.println( "z should be 8: "+z );
17 System.out.println( new Foo() );