equal to (==)
not equal to (!=)
/**
* @author lautturi.com
* Java example: not equal to
*/
import java.util.*;
public class Lautturi {
public static void main(String args[]) {
int i = 5;
if (i != 10) {
System.out.println("the i is not equal to 10");
}
String str = "hello";
if(!str.equals("Hello")) {
System.out.println("the string is not equal to Hello");
}
}
}Sourw:ecww.lautturi.comoutput:
the i is not equal to 10 the string is not equal to Hello