== null
checks for null
reference.
== ""
check for blank/empty string reference. Here you could use str.equals("")
to check if the string is empty/blank or not. ==
is used for object reference checks. Or you can use the String.isEmpty()
to check the same.
Also, if you use just if (userReorderSelection == null)
, then you'll only be checking if the userReorderSelection
is null
or not and it won't determine whether the String is empty or not.