I always wonder what happen to a new object let's say
final StringBuilder sb = new StringBuilder();
sb.append("some code");
After java create the new StringBuilder object, do what it does (without store it to a class variable) and exit the method, what happen to the StringBuilder object? It remain in ram or its removed by garbage collector?
I ask this because i design a game and i create many many objects upon each click such as a StringBuilder.