• Post Reply Bookmark Topic Watch Topic
  • New Topic

Strings and literal pool  RSS feed

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I want to learn ins and outs of String and how JVM and java complier use and create String literal pool. Please refer me some URL or some book that explains these concepts in complete detail, preferrably with examples....


Thanks.
 
Rakesh Jhamb
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please reply.
 
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any "Introduction to Java" book covers the basic ideas here. Is there something specific you want to ask?
 
Ranch Hand
Posts: 488
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest, I don't think Strings are that simple of a subject depending on how deep you want to get. When does a String come from the constant pool? Does the JVM use a StringBuilder when concatanating two Strings? Does calling the new method create a new String or not if it's already in the pool? etc... there are a lot of hidden details that aren't so introductory.

It's been a long time since I read up on String behavior, I will post later if I can find the article/paper I read. Also, you may just want to go into the SCJP forum and search for String pool... this topic has come up quite a few times in there.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!