Question: Given String s, what is the difference between s.equals(Stop) and Stop.equals(s)? a. Stop.equals(s) is not allowed in Java syntax b. Stop.equals(s) doesnt work when s
Given String s, what is the difference between s.equals("Stop") and "Stop".equals(s)?
a. "Stop".equals(s) is not allowed in Java syntax
b. "Stop".equals(s) doesnt work when s refers to an empty string
c. s.equals("Stop") raises an exception when s is null
d. No difference
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
