What Will Be The Correct Statement Of The Following C Codep Pre #311
What will be the Correct statement of the following C# code?</p> <pre><code class="language-csharp" line="1"> public class maths { public int x; public virtual void a() { } } public class subject : maths { new public void a() { } } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Object Oriented Concepts - Polymorphism - Quiz No.1.
What will be the Correct statement of the following C# code?
public class maths { public int x; public virtual void a() { } } public class subject : maths { new public void a() { } }
The subject class version of a() method gets called using sample class reference which holds subject class object
subject class hides a() method of base class
The code replaces the subject class version of a() with its math class version
None of the mentioned