What Will Be The Correct Statement In The Following C Codep Pre #357

What will be the Correct statement in the following C# code?</p> <pre><code class="language-csharp" line="1"> class sample { protected int index; public sample() { index = 0; } } class sample 1: sample { public void add() { index += 1; } } class Program { static void Main(string[] args) { sample 1 z = new sample 1(); z . add(); } } </code></pre>

Online Quiz 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 - Inheritance Implementation - Quiz No.1.

What will be the Correct statement in the following C# code?

 class sample { protected int index; public sample() { index = 0; } } class sample 1: sample { public void add() { index += 1; } } class Program { static void Main(string[] args) { sample 1 z = new sample 1(); z . add(); } } 

Similar question(s) are as followings:



Online Quizzes of gs108 CSharp

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background