Intellipaat 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

0 votes
1 answer
asked Oct 29, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer
0 votes
2 answers
asked Jul 9, 2019 in Java by Anvi (10.2k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...