• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is there a tool to monitor the java String pool

 
Ahmed Rezk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question number 91 in ******, I am not persuaded with the answer, I think it should be answer D ( 4 strings ) , UNLESS substring does not create a new copy

I need to ask whether trim also returns a new string or not ( it is explicitly mentioned in the book that toUpperCase, toLowerCase, replace, concat return a new modified copy of the string � a new string is created in the pool but this is not explicitly mentioned for trim and substring?


<Possible real exam question deleted>

[ November 22, 2006: Message edited by: Barry Gaunt ]
[ February 01, 2007: Message edited by: Barry Gaunt ]
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you tried if trim() returns a new String ? Why should some operations on a String return new/modified String and some modify the content of the original String ?

A hint: Strings are immutable. You can not change them. So ALL modifications will result in a copy.


try this:

pascal
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sort of mind-numbingly fascinating question belongs in SCJP.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
******? - where did you get this question? Is this ****** a braindump site? We do not allow braindump questions on this site because the use of them for passing certifications is considered to be cheating.

If no explanation - this topic will be deleted in near future.

[ November 22, 2006: Message edited by: Barry Gaunt ]
[ February 01, 2007: Message edited by: Barry Gaunt ]
 
Chris Hendy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this interesting article:

http://certcities.com/editorial/news/story.asp?EditorialsID=336&page=2

Braindump sites are now a Federal Crime.

Stick to K&B (or whatever your book of choice is) and mocks.
 
Chris Hendy
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as a tool is concerned, I have seen Jprofiler mentioned/recommended in a number of places. It's commercial but you can download an evaluation version.

http://www.ej-technologies.com/products/jprofiler/overview.html
[ November 22, 2006: Message edited by: Chris Hendy ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic