How many lines will be created in memory in case of the above code
One. (or actually two if you included "hmmmmmmmm")
This method returns a string literal constant :
public static string GetStr()
{
return "OK";
}
It compiled into something like the following IL code:
ldstr "OK"
ret
The LDSTR statement will refer to the string literal stored in the metadata , and RET opcode will return that link.
, "OK" . .
, . , " " , .