Question: In the above code, two strings are evaluated using the equivalency operator. Why can this be a problem, and what other methods are offered by

In the above code, two strings are evaluated using the equivalency operator. Why can this be a problem, and what other methods are offered by Java for working with characters and strings?
import java.util.Scanner; public class TryToCompareStrings public static void main(String[] args) String aName"Carmen"; String anotherName; Scanner input new Scanner(System.in) System.out.print("Enter your name>") anotherNmeinput.nextLineO: if(aNameanothen Name) System.out.println(aNameequals " + anotherName); else System.out.println (aName " does not equal "anotherName)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
