Sitemap

Member-only story

STRING-INTERVIEW-QUESTIONS

What Does String Pool Mean in Java?

5 min readSep 25, 2024

--

Press enter or click to view image in full size
String Pool Example with the intern() method

What is String Pool in Java?

String Objects Are Created in Two Ways:

1. Using double quotes(“ ”) [when String literals are used ]

String name1 = “Java”;

2. Using the ‘new’ keyword :

String name2 = new String(“newJava”);

--

--

Vikram Gupta
Vikram Gupta

Written by Vikram Gupta

-: Empowering Developers to Ace Their Technical Interviews :- A Senior Engineer building Scalable, Reliable, and Containerized Cloud Applications. 5M+ views.