if (x <> 0) {
doSomething();
}
This is not valid operator1 in Java2. So it won't compile. If you want to use non-equal operator you have to use !=
operator:
if (x != 0) { // this is valid use in Java
doSomething();
}
Here you can find list of all valid operators in Java.
Example of usage <> symbol in generics:
A generic class is defined with the following format: class name<T1, T2, ..., Tn> { ... }
Here, you can see "your symbol":
The type parameter section, delimited by angle brackets (<>), follows
the class name. It specifies the type parameters (also called type
variables) T1, T2, ..., and Tn.
For more information you need to have look at Java generics. Hope this will make things clearer.
1Symbol <>
is used in Java only while instantiating generic type.
2Symbol <>
is valid for example in SQL language. Look at SQL operators.