string not equals java code example
Example 1: java string not equal
String name = "John";
// prints true to standard system output.
System.out.print(!name.equals("Alex"));
Example 2: not equal java
// Int version
int i = 2;
if (i != 3) {}
// String version
String s = "a";
if(!s.equals("b")) {}