C# program to demonstrate the use of reflection objects
Program.cs
Console.WriteLine("———————————————————————————————————————————");Console.WriteLine("Program to use Reflection objects");Console.WriteLine("———————————————————————————————————————————");inti=0;floatf=0.0F;Typet1=i.GetType();Typet2=f.GetType();Typet3=typeof(System.String);Console.WriteLine(t1);Console.WriteLine(t2);Console.WriteLine(t3.Assembly);Console.WriteLine(t3.FullName);Console.WriteLine(t3.BaseType);Console.WriteLine(t3.IsClass);Console.WriteLine(t3.IsEnum);Console.WriteLine(t3.IsInterface);Console.WriteLine("———————————————————————————————————————————");
Output
kodingwindow@kw:~/csharp$ dotnet run
———————————————————————————————————————————
Program to use Reflection objects
———————————————————————————————————————————
System.Int32
System.Single
System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
System.String
System.Object
True
False
False
———————————————————————————————————————————
kodingwindow@kw:~/csharp$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?