+ 1
== and .equals difference?
Sololearn told me to use == to test if something was equal to something. But a error happened so I asked chatgpt and it said I should use .equals? If(variable == (1)) is wrong! It was, if(variable.equals (1))
1 Answer
+ 3
== checks the equality of a reference in memory; equals() checks the equality of values.
provide the complete code and task instruction.