Contoh Program Operator Perbandingan Pada Java
Source Code :
public class perbandingan {
public static void main (String [] args) {
System.out.println("Pebandingan");
int x=50, y=90;
System.out.println("x = 50\ny = 90");
System.out.println("X==Y :"+(x==y));
System.out.println("X!=Y :"+(x!=y));
System.out.println("XSystem.out.println("X>Y :"+(x>y));
System.out.println("X<=Y :"+(x<=y));
System.out.println("X>+Y :"+(x>=y));
}
}
public static void main (String [] args) {
System.out.println("Pebandingan");
int x=50, y=90;
System.out.println("x = 50\ny = 90");
System.out.println("X==Y :"+(x==y));
System.out.println("X!=Y :"+(x!=y));
System.out.println("X
System.out.println("X<=Y :"+(x<=y));
System.out.println("X>+Y :"+(x>=y));
}
}
Output :