Output true with if (a == 1 && a == 2 && a == 3) in Java (Invisible Identifier)

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

Output true with if (a == 1 && a == 2 && a == 3) in Java (Invisible Identifier)
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (PowerMockito edition)
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (Javassist second decoction)
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (black magic edition)
Split a string with ". (Dot)" in Java
Read a string in a PDF file with Java
Create a CSR with extended information in Java
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
Do not write if (isAdmin == true) code in Java
Quickly implement a singleton with an enum in Java
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (gray magic that is not so much as black magic)
Find a subset in Java
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (Royal road edition that is neither magic nor anything)
Implementing a large-scale GraphQL server in Java with Netflix DGS
Create a SlackBot with AWS lambda & API Gateway in Java
Do I need a test if I do DDD in a language with types?
Build a Java project with Gradle
Morphological analysis in Java with Kuromoji
3 Implement a simple interpreter in Java
I created a PDF in Java.
I can't create a Java class with a specific name in IntelliJ
Mixed Western calendar output in Java
Try an If expression in Java
Log output to file in Java
A simple sample callback in Java
Output PDF and TIFF with Java 8
[Java] Reduce if statements with Enum
Get stuck in a Java primer
Play with Markdown in Java flexmark-java
A story stuck with log output in Docker + Play framework environment
Determining if a custom keyboard is enabled in Android Studio (Java)
[Personal memo] How to interact with a random number generator in Java
Memo: [Java] If a file is in the monitored directory, process it.
I wrote a Lambda function in Java and deployed it with SAM
I want to ForEach an array with a Lambda expression in Java
About returning a reference in a Java Getter
What is a class in Java language (3 /?)
Concurrency Method in Java with basic example
Java creates a pie chart in Excel
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
Output Date in Java in ISO 8601 extended format
Create a TODO app in Java 7 Create Header
Try making a calculator app in Java
Implement something like a stack in Java
Creating a matrix class in Java Part 1
Working with huge JSON in Java Lambda
Configure a multi-project with subdirectories in Gradle
If a person from Java learns PHP
Let's make a calculator application with Java ~ Create a display area in the window
Validate the identity token of a user authenticated with AWS Cognito in Java
I made a primality test program in Java
GetInstance () from a @Singleton class in Groovy from Java
Let's write Java file input / output with NIO
Two ways to start a thread in Java + @
Create a simple bulletin board with Java + MySQL
Refactored GUI tools made with Java8 + JavaFX in 2016
Be careful if you find SHIFT-JIS in Java
[Windows] [IntelliJ] [Java] [Tomcat] Create a Tomcat9 environment with IntelliJ
Let's create a timed process with Java Timer! !!