2
Answers

How is this returning a new instance?

Guest User

Guest User

12y
1.3k
1
Hi

Given the following code example

// It returns the altered argument as a new instance of string.

public static string BetterThanPassTheReference(string argument)
{ return argument + " ABCDE"; }

I might be missing something obvious here but how is this method returning a new instance of string?

Could this be a shorthand notation for the following:-

String returnArguement = arguement + "ABCDE";

return returnArguement;

Regards



Answers (2)