C# এ CharEnumerator.GetType() পদ্ধতিটি বর্তমান উদাহরণের ধরন পেতে ব্যবহৃত হয়।
সিনট্যাক্স
public Type GetType();
আসুন এখন CharEnumerator.GetType() পদ্ধতি প্রয়োগ করার জন্য একটি উদাহরণ দেখি -
উদাহরণ
using System;
public class Demo {
public static void Main(){
string strNum = "john";
CharEnumerator ch = strNum.GetEnumerator();
Console.WriteLine("HashCode = "+ch.GetHashCode());
Console.WriteLine("Get the Type = "+ch.GetType());
while (ch.MoveNext())
Console.Write(ch.Current + " ");
// disposed
ch.Dispose();
// this will show an error since we disposed the object above
// Console.WriteLine(ch.Current);
}
} আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবেHashCode = 1373506 Get the Type = System.CharEnumerator j o h n