A simple and bogus answer to I want to output true with a == 1 && a == 2 && a == 3 even in Java
public class AmazingEqualEqualOperator {
public static void main(String[] args) {
int a=1,a=2,a=3;
if (a == 1 && a == 2 && a == 3) {
System.out.println("true");
} else {
System.out.println("false");
}
}
}
There are characters that are invisible but can be used in variables.
Here [two-way text](https://ja.wikipedia.org/wiki/%E5%8F%8C%E6%96%B9%E5%90%91%E3%83%86%E3%82%AD The control character U + 202C Pop directional formatting (PDF) used in% E3% 82% B9% E3% 83% 88) is used. In other words, int a, a \ u202C, and a \ u202C \ u202C are just three types of variables that have the same appearance.
Character.html#isJavaIdentifierStart(char) Character.html#isJavaIdentifierPart(char) By using, it is possible to determine whether the character is used at the beginning of the Java identifier or the character used for migrating the second character of the Java identifier.
Recommended Posts