You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tested the String comparison example given on the String reference page in Processing 3.3.6:
// Comparing String objects, see reference below.
String p = "potato";
if (p == "potato") {
println("p == potato, yep."); // This will not print
}
// The correct way to compare two Strings
if (p.equals("potato")) {
println("Yes, the contents of p and potato are the same.");
}
Issue description
When I tested the String comparison example given on the String reference page in Processing 3.3.6:
Both lines print due to String interning in Java.
URL(s) of affected page(s)
https://processing.org/reference/String.html
Proposed fix
Use a different example:
The text was updated successfully, but these errors were encountered: