What Will Be The Output Of The Following C Codep Pre Langcsharp #204
What will be the output of the following C# code?</p> <pre><code class="language-csharp" line="1"> class abc { public static void a() { console.writeline("first method"); } public void b() { a(); console.writeline("second method"); } public void b(int i) { console.writeline(i); b(); } } class program { static void main() { abc k = new abc(); abc.a(); k.b(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 Classes - Constructors in Class - Quiz No.1.
What will be the output of the following C# code?
class abc { public static void a() { console.writeline("first method"); } public void b() { a(); console.writeline("second method"); } public void b(int i) { console.writeline(i); b(); } } class program { static void main() { abc k = new abc(); abc.a(); k.b(20); } }
second method 20 second method first method
first method 20 first method second method
first method 20
second method 20 first method