dimanche 31 janvier 2016

What the hell is going on with IF in java [duplicate]

This question already has an answer here:

The result of "status" is "ok" but it doesn't seem like this in if statement. The value of "result" is "default". What the hell o.O

post_data = new JSONObject(responseText);
System.out.println("status: " + post_data.getString("status"));
if (post_data.getString("status") == "ok") {
    System.out.println("if: ok");
    result = post_data.getString("url");
} else {
    result = "default";
}

Aucun commentaire:

Enregistrer un commentaire