In Java 3 = 12
virtualspecies.com
In Java 3 = 12
1–10 of 55 posts
Re: In Java 3 = 12
#22) The price you pay for type coercion. Be thankful Java defines the order of evaluation. Not all languages which coerce specify the order of evaluation.
Re: In Java 3 = 12
#3"foo" == TRUE and "foo" == 0 but TRUE != 0
123 == "123foo" but "123" != "123foo"
"6" == " 6", "4.2" == "4.20" and "133" == "0133", but 133 != 0133, "0x10" == "16" and "1e3" == "1000"
Re: In Java 3 = 12
#4Re: In Java 3 = 12
#51) Left-associativity 2) The price you pay for type coercion. Be thankful Java defines the order of evaluation. Not all languages which coerce specify the order of evaluation.
Re: In Java 3 = 12
#6And in php (after https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ ): "foo" == TRUE and "foo" == 0 but TRUE != 0 123 == "123foo" but "123" != "123foo" "6" == " 6", "4.2" == "4.20" and "133" == "0133", but 133 != 0133, "0x10" == "16" and "1e3" == "1000"
Re: In Java 3 = 12
#7https://dotnetfiddle.net/0vkSCV
Used .NET for 15 years and never knew this...
Re: In Java 3 = 12
#81) Left-associativity 2) The price you pay for type coercion. Be thankful Java defines the order of evaluation. Not all languages which coerce specify the order of evaluation.
While Python is very dynamic, but:
>>> print(1 + 2 + "=" + 1 + 2)
Traceback (most recent call last):
File "", line 1, in
TypeError: unsupported operand type(s) for +: 'int' and 'str'Re: In Java 3 = 12
#91) Left-associativity 2) The price you pay for type coercion. Be thankful Java defines the order of evaluation. Not all languages which coerce specify the order of evaluation.
Yes but that's strange. Java is such a staticaly typed language you would not expect it to do that if you are like me and don't know it very well. While Python is very dynamic, but: >>> print(1 + 2 + "=" + 1 + 2) Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str'
Re: In Java 3 = 12
#101) Left-associativity 2) The price you pay for type coercion. Be thankful Java defines the order of evaluation. Not all languages which coerce specify the order of evaluation.
Yes but that's strange. Java is such a staticaly typed language you would not expect it to do that if you are like me and don't know it very well. While Python is very dynamic, but: >>> print(1 + 2 + "=" + 1 + 2) Traceback (most recent call last): File " ", line 1, in TypeError: unsupported operand type(s) for +: 'int' and 'str'
you are seeing this error because python is strong typing language.
but this is weird that java is also strong typing language[0]
0: https://en.m.wikipedia.org/wiki/Java_(programming_language)