typeof Operator

The typeof operator in C# on the other hand returns an instance of the System.Type class containing type declarations of the type you pass to it.

Type t = typeof(string); 

This operator returns an instance of the System.Type class containing type declarations of the type you pass to it.

System.Type type = typeof(int); 

The typeof operator cannot be overloaded.


VB.Net

The equivalent in VB.Net is the GetType Operator
There is a TypeOf Operator in VB.Net but it has a different meaning - which is extremely confusing.


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext