Originally posted by Marlene Miller:
The same constant is loaded. Does that suggest that the same String object is being referenced?
Hi Marlene,
Yes, I think its the same 'Object'.
From the book "Inside the
Java Virtual Machine by Bill Venners"
Three opcodes (ldc,ldc_w, ldc2_w) push constants from the constant pool. These opcodes take operands that specify a constant pool index. The Java virtual machine looks up the constant pool entry given the index, determines the constant's type and value, and pushes it onto the stack.