Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (13.1k points)
Can anyone help me understand what is String Pool in Java? And what exactly it does?

1 Answer

0 votes
by (26.7k points)

Basically, it is a method to compare the strings which will print the value as true even without the use of the equals method. You can take the below example as a reference:

String s = "a" + "bc";

    String t = "ab" + "c";

    System.out.println(s == t);

I hope this will help.

Want to know more about Java? Prefer this tutorial on Learn Java.

Want to become a Java Expert? Join Java Training now!!

Related questions

Browse Categories

...