Friday, August 29, 2014

Logika Exlusif Java

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author MIFTAHUL ILMI
 */
public class LogikaEkslusif {
public static void main (String[]args){

    boolean val1 = true;
    boolean val2 = true;

    System.out.println(val1 ^ val2);

    val1 = false;
    val2 = true;
    System.out.println(val1 ^ val2);


    val1 = false;
    val2 = true;
    System.out.println(val1 ^ val2);

    val1 = true; val2=false;
    System.out.println(val1^val2);

}
}

No comments:

Post a Comment