In The Following C Code Which Statements Are Perfectly Validp #631
In the following C# code, which statements are perfectly valid?</p> <pre><code class="language-csharp" line="1"> 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); } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Delegates, Generics and LINQ - Generic Methods - Quiz No.1.
In the following C# code, which statements are perfectly valid?
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); } }
Run time exception error
Compile time error
Code runs successfully and prints required output
None of the mentioned