CoinToss.java



public class CoinToss {

    public static void main( String[] args ) {

        boolean b = Math.random() > 0.5;

        if( b )
            System.out.println( "Coin shows head" );
        else 
            System.out.println( "Coin shows tail" );
    }
}