Question

What is the output of the following Java code?     public class Test {         public static void main(String[] args) {             String s1 = "Java";             String s2 = new String("Java");             String s3 = s2.intern();             System.out.println(s1 == s2);             System.out.println(s1 == s3);         }     }

A true, true
B false, false
C false, true
D true, false
E Compilation error
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)