Click here to Skip to main content
16,004,836 members
Home / Discussions / C#
   

C#

 
GeneralRe: the global Hook doesnt work Pin
Dave Kreskowiak18-May-04 2:27
mveDave Kreskowiak18-May-04 2:27 
GeneralRe: the global Hook doesnt work Pin
fu019-May-04 23:28
fu019-May-04 23:28 
GeneralRe: the global Hook doesnt work Pin
Dave Kreskowiak20-May-04 0:54
mveDave Kreskowiak20-May-04 0:54 
GeneralStarting a Crystal Report on another databaseserver Pin
jvbragt17-May-04 22:33
jvbragt17-May-04 22:33 
GeneralRe: Starting a Crystal Report on another databaseserver Pin
Heath Stewart18-May-04 4:28
protectorHeath Stewart18-May-04 4:28 
Generaloops Pin
sreejith ss nair17-May-04 21:35
sreejith ss nair17-May-04 21:35 
GeneralRe: oops Pin
Daniel Turini18-May-04 0:42
Daniel Turini18-May-04 0:42 
GeneralRe: oops Pin
Aryadip18-May-04 0:57
Aryadip18-May-04 0:57 
hi,

Answer to your first question :
class A
{
public virtual void Display()
{
// I'm in the base class
}
}
class B : A
{
public override void Display()
{
// I'm in the derived class
}
}
the notable thing in this piece of code is the use of the word "override". This example demonstrates the polymorphic behaviour. If "Display()" is called from an object of class B the overridden display of class B will be called. Where as if the same function is called from the object of class A then the base class Display will be called.
Internally this is done by maintaining a virtual pointer table. Whenever user tries to call the Disply method thru the derived class object the CLR looks at the VPTR table and determines which Display method to call and resolves the same...

Answer to your second Question :
Assume a class hierarchy :
Living_Organism
|
Mammal Insect
|
Boy Girl

Now in this heirarchy the class Boy is indirectly inherited from the top level class "Living_Organism" thus this is a multilevel inheritence.

But if you derive a class from two classes at the same time then it is called multiple inheritence. For example

class IceCream : Milk,Food
{
}
class IceCream demonstrates multiple inheritence because it is derived from more then one class (Milk and Food).

Note : Multiple inheritence is not allowed directly in C#. But you can simulate it upto some extent by inheriting a class from another class and an interface.

class Test : Name ,IAge
{
}
the class Test is derived from a class "Name" and an interface "IAge".

You can know more about all these from the following link...

http://www.windowsitlibrary.com/Content/1040/05/1.html

Hope this answers your query...
regards,
Aryadip.

Cheers !! and have a Funky day !!
GeneralViewing ascii in datagrid Pin
dabuskol17-May-04 21:32
dabuskol17-May-04 21:32 
GeneralRe: Viewing ascii in datagrid Pin
Heath Stewart18-May-04 4:31
protectorHeath Stewart18-May-04 4:31 
Generaloops Pin
sreejith ss nair17-May-04 21:31
sreejith ss nair17-May-04 21:31 
GeneralImage Rotation in C# Pin
mmxguy17-May-04 21:07
mmxguy17-May-04 21:07 
GeneralMessage Removed Pin
17-May-04 23:21
wibblewibblewibble17-May-04 23:21 
GeneralRe: Image Rotation in C# Pin
mmxguy18-May-04 0:00
mmxguy18-May-04 0:00 
GeneralRe: Image Rotation in C# Pin
Heath Stewart18-May-04 3:40
protectorHeath Stewart18-May-04 3:40 
GeneralWriting a bot in C# Pin
kashif Syed17-May-04 20:42
kashif Syed17-May-04 20:42 
GeneralRe: Writing a bot in C# Pin
Heath Stewart18-May-04 3:44
protectorHeath Stewart18-May-04 3:44 
GeneralImage Transparent for Web Pin
Anonymous17-May-04 19:32
Anonymous17-May-04 19:32 
GeneralRe: Image Transparent for Web Pin
Paul Watson17-May-04 23:39
sitebuilderPaul Watson17-May-04 23:39 
GeneralRe: Image Transparent for Web Pin
Dave Kreskowiak18-May-04 0:13
mveDave Kreskowiak18-May-04 0:13 
GeneralRe: Image Transparent for Web Pin
Heath Stewart18-May-04 3:45
protectorHeath Stewart18-May-04 3:45 
GeneralRe: Image Transparent for Web Pin
Dave Kreskowiak18-May-04 10:11
mveDave Kreskowiak18-May-04 10:11 
GeneralRe: Image Transparent for Web Pin
Heath Stewart18-May-04 10:15
protectorHeath Stewart18-May-04 10:15 
GeneralHELP on Blob analysia on captured images Pin
Rais Hafidz17-May-04 18:52
Rais Hafidz17-May-04 18:52 
Generalthread confusion Pin
macromark17-May-04 18:19
macromark17-May-04 18:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.