हाँ, बनाने के लिए चीजें आसान आप के रूप में यह सोच सकते हैं
स्ट्रिंग शाब्दिक पूल क्या है और यह कैसे काम करता के बारे में अधिक जानकारी के लिए यहाँ देखो एक ही पते से चुनना, लेकिन अधिक सटीक चर होने के लिए संदर्भ - पहचानकर्ता जो JVM ऑब्जेक्ट के उचित स्मृति पते पर मैप करने के लिए उपयोग कर सकता है (क्योंकि वस्तुओं को स्मृति में स्थानांतरित किया जा सकता है)।
आप इस तरह कोड से यह परीक्षण कर सकते हैं:
String w1 = "word";
String w2 = "word";
String b = new String("word"); // explicitly creating String by calling `new` operator
// won't put it in string pool
System.out.println(w1 == w2); // true -> variables hold same reference
System.out.println(w1 == b); // false -> variable hold different references
b = b.intern(); // check if pool contains this string, if not put this string in pool,
// then return reference of such string from pool and store it in b variable
System.out.println(w1 == b); // true -> now w1 and b hold same reference
मुझे लगता है कि जवाब है हां। –