Page 1 of 1

In the following C# code, which statements are perfectly valid?

Posted: Wed Jul 13, 2022 7:57 pm
by answerhappygod
public class Csharp{ public void subject<S>(S arg) { Console.WriteLine(arg); }}class Program{ static Void Main(string[] args) { Csharp c = new Csharp(); c.subject("hi"); c.subject(20); }}
a) Run time exception error
b) Compile time error
c) Code runs successfully and prints required output
d) None of the mentioned