Revision e11dbf4c-8d29-4661-9270-a594083c885c - Stack Overflow
In _weakly typed_ languages such as JavaScript you can use the strict comparison operator (`===`) because you can compare values which have different _types_.
For example you won't get a _compile error_ if you do this:
var x = 10;
var y = 'foo';
console.log(x == y)
And it is useful, when you want to compare variables which hold values that are "equals" but may be of different types.
For example
var x = 10;
var y = '10';
console.log(x == y) // true
console.log(x === y) // false
In _strongly typed_ languages such as Java, you are not allowed to do this: you cannot compare values whose types do not match.
For example, you cannot do this:
int x = 10;
String y = "foo";
System.out.println(x == y); // compile error
So, basically in Java, there is no need for checking for strictness, because, in the first place, the compiler won't let you compare values of different types.
Some useful readings are:
- [15.21. Equality Operators][1]
- https://stackoverflow.com/questions/2690544/what-is-the-difference-between-a-strongly-typed-language-and-a-statically-typed
[1]: https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.21