নির্দিষ্ট টাইপ হ্যান্ডেল দ্বারা উল্লেখিত প্রকার পেতে, কোডটি নিম্নরূপ -
উদাহরণ
using System;
public class Demo {
public static void Main() {
Type type1 = typeof(short);
RuntimeTypeHandle typeHandle = Type.GetTypeHandle(type1);
Type type = Type.GetTypeFromHandle(typeHandle);
Console.WriteLine("Attributes = " + type.Attributes);
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেAttributes = AutoLayout, AnsiClass, Class, Serializable, BeforeFieldInit
উদাহরণ
আসুন আরেকটি উদাহরণ দেখি -
using System;
public class Demo {
public static void Main() {
Type type1 = typeof(System.Type);
RuntimeTypeHandle typeHandle = Type.GetTypeHandle(type1);
Type type = Type.GetTypeFromHandle(typeHandle);
Console.WriteLine("Attributes = " + type.Attributes);
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেAttributes = AutoLayout, AnsiClass, Class, Serializable, BeforeFieldInit