What Will Be The Output Of The Following Code: using System; public class Program { public static void Main(string[] args) { char[] num = { '1', '2', '3' }; Console.WriteLine(" char array: " + num); } }
What Will Be The Output Of The Following Code: using System; public class Program { public static void Main(string[] args) { Program obj = null; Console.WriteLine(Program.print()); } private static String print() { return "Hi, I am a Tech-savvy!!"; } }
What Will Be The Output Of The Following Code: using System; using System.Collections.Generic; public class Program { public static void Main(string[] args) { string[] strings = { "abc", "def", "ghi" }; var actions = new List(); foreach (string str in strings) actions.Add(() => { Console.WriteLine(str); }); foreach (var action in actions) action(); } }
What Will Be The Output Of The Following Code: using System; using System.Collections.Generic; public class Program { public static void Main(string[] args) { var actions = new List(); for (int i = 0; i < 4; i++) actions.Add(() => Console.WriteLine(i)); foreach (var action in actions) action(); } }
What Will Be The Output Of The Following Code: using System; using System.Collections.Generic; namespace TechBeamers { delegate string del(string str); class sample { public static string DelegateSample(string a) { return a.Replace(',', '*'); } } public class InterviewProgram { public static void Main(string[] args) { del str1 = new del(sample.DelegateSample); string str = str1("Welcome,,friends,,to,,TechBeamers"); Console.WriteLine(str); } } }