Guest User

Guest User

  • Tech Writer
  • 357
  • 120.1k

How is this returning a new instance?

Aug 16 2012 3:10 PM
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)