To add on to the other answers: this is a technique called string interning where the compiler realizes that the strings are the same and therefore only stores them once. Java tends to do this as well (though, as mentioned by the other poster, it's compiler-dependent).