Q. 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
  • (C) 0
  • (D) 0 D. 1
πŸ’¬ Discuss
βœ… Correct Answer: (B) false

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
123
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ravi Shankar
Publisher
πŸ“ˆ
98%
Success Rate