Question d’entretien chez 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?

Réponse à la question d'entretien

Utilisateur anonyme

10 mars 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