Java expert please help If two strings are equal, the two strings have the same
ID: 3834202 • Letter: J
Question
Java expert please help
If two strings are equal, the two strings have the same hashCodes. true false Which statement is true of the following snippet? Scanner kybd = new Scanner(System.in); String inp = kybd. next (); int i = 0; int n = 0; if (inp == "sophie") i = 3; if ("sophie".equalsIgnoreCase(inp)) n = 5; System. out. print-In ("result is " + (i + n) ) ; kybd. close () ; the code never prints 0 if the user enters sophie the code prints 8 if the user enters sophie or SOPHIE the code prints 5 there is a compile problem at line 11Explanation / Answer
13) If two strings are equal than its not mandatory their hashcodes are always equal .it can be equal but not everytime.
So this statement is false.
14) Answer is b
If user enters shopie the code prints 8