How System.Type in class in C# work?
as system.type class used reflection. , of members defined in system.type is abstract. in code fullname property used class name, declared abstract in system.type
namespace consoleapplication93 { class myclass { int val; } class program { static void main(string[] args) { type t = typeof(myclass); console.writeline(t.fullname); console.readline(); } } }
is fullname implementation ??
update: here how it system.type defines
public abstract string fullname { get; }
abstract actual implementation of property
is clr providing code ??
i unable understand how abstract class (system.type) can call abstract property ?
hi,
interesting question. notice myself. try code below. , returns system.runtimetype
console.writeline(typeof(asciiencoding).gettype());
i check msdn , it's give clear explanation.
http://msdn.microsoft.com/en-us/library/system.type(v=vs.110).aspx
"type is abstract base class allows multiple implementations. system provide derived class runtimetype. in reflection, classes beginning word runtime created once per object in system , support comparison operations."
hope helps
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment