Strings are immutable reference types. There's the ldstr IL instruction which allows pushing a new object reference to a string literal. So when you write:
string a = "abc";
The compiler tests if the "abc"
literal has already been defined in the metadata and if not declare it. Then it translates this code into the following IL instruction:
ldstr "abc"
Which basically makes the a
local variable point to the string literal defined in the metadata.
So I would say that your answer is not quite right as the compiler doesn't translate this into a call to a constructor.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…