double x = new Double("123.45").doubleValue();
If we take "123.45" as
String literal, then I don't think it will be garbage collected anytime.
All String literal will be kept in the String pool and will be used by the JVM in all future references for the same literal.
I hope I am right, but I am not sure. Please correct me if I am wrong.
Regards
Ramki.