The best method to get number of instances created of a specific class is - , make a static 'count' varible and increment it in constructor call, so that you can access that count method through a static method like "static int getCount()" to return the no of objects created ..
Now as per Java api , there is no such method in String class, and String class is "final" , you cant create your own .
And other way to do this , might go from complier and memory management programming or ask sun .
The only definitive solution would be to run the code through a profiler.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I can't help you any further; I haven't used it since late 2003 when I was investigating it for my master's thesis.
Now I don't know about integration in Netbeans, but with its documentation you should be able to run it from the command line. [ June 01, 2008: Message edited by: Rob Prime ]