Note that this can be considered good coding practice, as it avoids that any
NullPointerException might occur. obj.equals("...") may cause such an
exception.
Regards,
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi!
Can someone give an example of Java source code where a StringLiteral as a
subtype of ReferencePrefix appears?
Thanks!
Hej!
Sure:
"Hello, world".equals(obj);
Note that this can be considered good coding practice, as it avoids that any
NullPointerException might occur. obj.equals("...") may cause such an
exception.
Regards,
Tobias