Pergunta de entrevista da empresa RBC

private static string a = "first"; static void Method(string a) { a = "second"; } static void Main(string[] args) { Console.WriteLine(a); Method(a); Console.WriteLine(a); } What would be the output of the above? and what to do change it?

Resposta da entrevista

Sigiloso

10 de mar. de 2018

First output would be first first Then asked to change it to make it "first and Second" Just changed the parameter name from "a" to "b"

2