|
INTERVIEW QUESTIONS
MICROSOFT
DOTNET
DETAILS
Question: How would you implement inheritance using VB.NET/C#?
Answer: When we set out to implement a class using inheritance, we must first start with an existing class from which we will derive our new subclass. This existing class, or base class, may be part of the .NET system class library framework, it may be part of some other application or .NET assembly, or we may create it as part of our existing application. Once we have a base class, we can then implement one or more subclasses based on that base class. Each of our subclasses will automatically have all of the methods, properties, and events of that base class including the implementation behind each method, property, and event. Our subclass can add new methods, properties, and events of its own - extending the original interface with new functionality. Additionally, a subclass can replace the methods and properties of the base class with its own new implementation - effectively overriding the original behavior and replacing it with new behaviors. Essentially inheritance is a way of merging functionality from an existing class into our new subclass. Inheritance also defines rules for how these methods, properties, and events can be merged.
|
|
|
Category |
DotNet Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.2) By 8633 users |
Added on |
5/31/2011 |
Views |
77425 |
Rate it! |
|
|
Question:
How would you implement inheritance using VB.NET/C#?
Answer:
When we set out to implement a class using inheritance, we must first start with an existing class from which we will derive our new subclass. This existing class, or base class, may be part of the .NET system class library framework, it may be part of some other application or .NET assembly, or we may create it as part of our existing application. Once we have a base class, we can then implement one or more subclasses based on that base class. Each of our subclasses will automatically have all of the methods, properties, and events of that base class including the implementation behind each method, property, and event. Our subclass can add new methods, properties, and events of its own - extending the original interface with new functionality. Additionally, a subclass can replace the methods and properties of the base class with its own new implementation - effectively overriding the original behavior and replacing it with new behaviors. Essentially inheritance is a way of merging functionality from an existing class into our new subclass. Inheritance also defines rules for how these methods, properties, and events can be merged. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
Explain what a diffgram is, and a good use for one
|
View Answer
|
|
Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one
|
View Answer
|
|
Can you explain what inheritance is and an example of when you might use it?
|
View Answer
|
|
What are the disadvantages of viewstate/what are the benefits
|
View Answer
|
|
Describe session handling in a webfarm, how does it work and what are the limits
|
View Answer
|
|
How would you get ASP.NET running in Apache web servers - why would you even do this?
|
View Answer
|
|
Whats MSIL, and why should my developers need an appreciation of it if at all?
|
View Answer
|
|
In what order do the events of an ASPX page execute. As a developer is it important to understand these events?
|
View Answer
|
|
Which method do you invoke on the DataAdapter control to load your generated dataset with data?
|
View Answer
|
|
Can you edit data in the Repeater control?
|
View Answer
|
|
Which template must you provide, in order to display data in a Repeater control?
|
View Answer
|
|
How can you provide an alternating color scheme in a Repeater control?
|
View Answer
|
|
What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
|
View Answer
|
|
What base class do all Web Forms inherit from?
|
View Answer
|
|
What method do you use to explicitly kill a user session?
|
View Answer
|
|
Can you explain what inheritance is and an example of when you might use it?
|
View Answer
|
|
How do you turn off cookies for one page in your site?
|
View Answer
|
|
Which two properties are on every validation control?
|
View Answer
|
|
What tags do you need to add within the asp:datagrid tags to bind columns manually?
|
View Answer
|
|
How do you create a permanent cookie?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All DotNet Interview Questions & Answers - Exam Mode /
Learning Mode
|