An explicit operator are call to the cast operators. A user require to make sure that cast is valid. So the main purpose of explicit is user's define type conversion operator. In other word, a user involves casting from one type to another type through explicit conversion.
Example
using System;
class class1 // Create class
{
public void show() //create function
{
Console.WriteLine("to Noida");
}
//Explit operator which convert of class1's type to class2 type
public static explicit operator class2(class1 a)
{
return new class2() ;
}
}
class class2
{
public void show()
{


Join the conversation! Your thoughts help the community grow.