Office Document APIs for .NET
ITIL Career Advice
PMP Career Advice
Android Intel XDK
Welcome Guest !
Which of the following statement is correct with respect to the below code snippet?
protected int count;
count = 0;
class index1: index
public void increment()
count = count +1;
static void Main(string args)
index1 i = new index1();
1.count should be declared as public if it is to become available in the inheritance chain.
2.count should be declared as protected if it is to become available in the inheritance chain.
3.While constructing an object referred to by i firstly constructor of index class will be called followed by constructor of index1 class.
4.Constructor of index class does not get inherited in index1 class.
on 1/15/2014 | Category:
C# Interview questions
| Views: 3826 |
Select from following answers:
1, 2 3
2, 3, 4
All the above
The subclass can inherit only the member variable and function not constructor if you want call the constructor of base class. You must have to create the object first of the base class.
When we declare as protected, it will availabe to subclass, it take intial value as zero for count variable, then it get increment.
Show Correct Answer
Many Interviews |
< Previous :
What is the role played by physical layer?
Next > :
Which of the following is true with respect to inh ...
Comments or Responses
Login to post response
More Interview Questions by Kmandapalli
Which of the following is true with respect to inheritance mechanism? ...
Which of the following is correct about data types? 1.If the integer ...
Which of the following statement is correct? 1.The signature of an in ...
Output for the following code? namespace IndiabixConsoleApplication ...
How many times can a constructor be called during the life time of an ...
Which of the following is correct with respect to static functions? 1 ...
Which of the following statement is true?
Which of the following statement is true with respect to polymorphism?
Latest Interview Questions
What will be the output of below statement? alert(NaN == NaN);
What is the difference between below statement? var func = function ...
What is the best example of Fragment Caching?
Which property is used to bind Repeater Control?
What is the life of a View-State items?
DataSet and DataTable class are present in which NameSpace?
How to set all letters or text in lower-case?
What property do we require to add within the Gridview tags to bind co ...