Vidyalelo
Java Programming · Q32

Strings

Programming · Java Programming · question 32

Q32

What will be the output of the following program code? class LogicalCompare public static void main(String args[]) String str1 = new String("OKAY"); String str2 = new String(str1); System.out.println(str1 == str2);

A.
true
B.
false
Answer
C.
0
D.
1
E.
Displays error message

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board