Solved

Suppose We Want to Condition an If Statement on Whether

Question 21

Multiple Choice

Suppose we want to condition an if statement on whether two String objects, referenced by stringOne and stringTwo, are the same. Which of the following is the correct way to achieve this?


A) if(stringOne == stringTwo)
B) if(stringOne.compareTo(stringTwo) )
C) if(stringOne.equals(stringTwo) )
D) if(stringOne != stringTwo)
E) if(stringOne === stringTwo)

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions