Friday, August 29, 2014

Logika Boolean Java

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

/**
 *
 * @author MIFTAHUL ILMI
 */
public class LogikadanBolean {
    public static void main (String[]args) {
        int i = 0;
        int j = 10;
        boolean test=false;

        //Demonstrasi&&
        test = (i>10) && (j++ > 9);
        System.out.println(i);
        System.out.println(j);
        System.out.println(test);

        //Demonstrasi
        test = (i>10) & (j++ > 9);
        System.out.println(i);
        System.out.println(j);
        System.out.println(test);

    }

}

No comments:

Post a Comment