boolean value exclusive Or - Java java.lang

Java examples for java.lang:boolean

Description

boolean value exclusive Or

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        boolean b = true;
        boolean c = true;
        System.out.println(exclOr(b, c));
    }/*from   w  w  w  . j av  a2  s.c om*/

    private static boolean exclOr(boolean b, boolean c) {
        return (b && !c || !b && c) ? true : false;
    }
}

Related Tutorials