Is there are way to access the contents of the String constant pool within our own program?
Say I have some basic code that does this:
String str1 = "foo";
String str2 = "bar";
There are now 2 strings floating around in our String constant pool. Is there some way to access the pool and print out the above values or get the current total number of elements currently contained in the pool?
i.e.
StringConstantPool pool = new StringConstantPool();
System.out.println(pool.getSize()); // etc