.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> OOPS >> Post New Question Subscribe to Interview Questions

How would you implement inheritance using VB.NET/C#?

Posted By :nishithraj     Posted Date :December 28, 2009    Points :10   Category :OOPS 
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.

You can also find related Interview Question to How would you implement inheritance using VB.NET/C#?  below: 

Can we implement Multiple Inheritance by using Abstract Class?

  
No.
As the abstarct class can contain simple methods also, therefore it doesn't support Multiple Inheritance in DotNet. (More...)

Does C# support multiple inheritance?

  
No

C# does not support multiple inheritance. A class can inherit from maximum one base class, although it can implement any number of interfaces. Like Java, C# does not support multiple inheritance, meaning that classes cannot inherit from more than one class (More...)

If you are using C language to implement the heterogeneous linked list, what pointer type will you use?

  
The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type. (More...)

Minimum number of queues needed to implement the priority queue?

  
Two. One queue is used for actual storing of data and another for storing priorities. (More...)

What is difference between interface inheritance and class inheritance?

  
We can only inherit from one class but multiple interfaces. In addition, an interface does not contain any implementation it just contains a series of signatures. (More...)

How do you implement thread synchronization (Object.Wait, Notify,and CriticalSection) in C#?

  
You want the lock statement, which is the same as Monitor Enter/Exit: (More...)

How do you Implement Timer Control in Javascript?

  
set Timedout("alert('5 seconds')",5000); Here the argument 5000 shows the millisecond value. (More...)

What is inheritance and when would you use inheritance?

  
The concept of child class inheriting the behavior of the parent is called inheritance.

If there are many classes in an application that have some part of their behavior common among all , inheritance would be used. (More...)

Can you explain what inheritance is and an example of when you might use it?

  
Inheritance is a fundamental feature of an object oriented system and it is simply the ability to inherit data and functionality from a parent object. Rather than developing new objects from scratch, new code can be based on the work of other programmers, adding only new features that are needed. (More...)

can we impliment multiple inheritance by using interfaces in C#.net?

  
yes we can implement:

Inheritance Usage Example:
Here is a syntax example for using Implementation Inheritance.


Class derivedClass:baseClass
{
}

derivedClass is derived from baseClass.

Interface Inheritance example:
private Class derivedClass:baseClass , InterfaceX , InterfaceY ....
{
}

(More...)

Is dotnet frameword needed to implement silverlight?

  
No, It's a cross platform version of the .NET Framework which is included in the 6 MB Silverlight 4 download, so you do not need to have anything extra to be installed on the client in order to access Silverlight applications in the browser. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend