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(); }}
a) Index should be declared as protected if it is to become available in inheritance chain
b) Constructor of sample class does not get inherited in sample 1 class
c) During constructing an object referred to by z, Firstly constructor of sample class will be called followed by constructor of sample 1 class
d) All of the mentioned
What will be the Correct statement in the following C# code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the Correct statement in the following C# code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!