Archive for November, 2011


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

/**
*
* @author Muhammad Khafid F
*/
public class operator_logika_3 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
boolean val1=true;
boolean val2=true;
System.out.println(val1^val2);

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

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

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

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

/**
*
* @author Muhammad Khafid F
*/
public class operator_logika_2 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int i;
i=0;
int j;
j=10;
boolean test;
test=false;

test=(i>10)||( j++>9);
System.out.println(i);
System.out.println(j);
System.out.println(test);

test=(i>10)|( j++>9);
System.out.println(i);
System.out.println(j);
System.out.println(test);
}
}

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

/**
*
* @author Muhammad Khafid F
*/
public class operator_logika {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int i;
i=0;
int j;
j=10;
boolean test;
test=false;

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

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

}
}