|
|
|
|
|
by babuskov
203 days ago
|
|
Funny that you picked == as an example when == is very counter intuitive in Java and is one of the common pitfalls for beginners: String a = new String();
String b = new String();
a = "test";
b = a + "";
if (a == "test")
{
// true
}
if (b == "test")
{
// false
}
if (a == b)
{
// false
}
Just like PHP, you have to read the docs to use it properly. |
|