Click here to Skip to main content
12,819,538 members (32,629 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# C#4.0
I have two classes Class1 and Program a shown below:
class Class1
     public void xx()


 class Program : Class1
     static void Main(string[] args)


Here is the output from SOS debugger......
!dumpmt -md  00153898
EEClass:      00151474
Module:       00152ea4
Name:         ConsoleApplication24.Program
mdToken:      b1d44c0002000003
File:         E:\c#\ConsoleApplication24\ConsoleApplication24\bin\Debug\ConsoleApplication24.exe
BaseSize:        0xc
ComponentSize:   0x0
Slots in VTable: 6
Number of IFaces in IFaceMap: 0
MethodDesc Table
   Entry MethodDesc      JIT Name
530ba790   52e94cd8   PreJIT System.Object.ToString()
530be290   52e94ce0   PreJIT System.Object.Equals(System.Object)
530be1a0   52e94d00   PreJIT System.Object.GetHashCode()
531417b0   52e94d14   PreJIT System.Object.Finalize()
0015c038   0015388c     NONE ConsoleApplication24.Program..ctor()
0015c030   0015387c      JIT ConsoleApplication24.Program.Main(System.String[])

But why here i not seen the inherited functions ( ie xx() from Class1 )in "Program class"??????
Because when i create instance of Program class and access method xx() then how it finds the
Posted 10-Nov-12 4:30am
OriginalGriff 10-Nov-12 9:43am
Don't create a new question to add information - use the Improve Question widget instead.
I have deleted the "spare" question.
Abhishek Pant 10-Nov-12 9:54am
it seems that you didn't created a object to inherit the property of class1

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The compiler already knows it is non-virtual so it directly generates a call to Class1.xx(). Use ildasm.exe to look at the generated IL.
here the address of the method xx() from Class1's method table is burn by clr and emits call to it.Here clr not required the object reference to class1's method table.......clr does it automatically....
Nelek 10-Nov-12 11:06am
Is this a solution (it doesn't look like it)? or are you giving further information? You were already told to use the widget "improve question" if you need to edit the text and/or add information to your message
fdiu 10-Nov-12 13:54pm
Why its not looks like solution ?
It is solution... :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100