1 // cs_keyword_implicit.cs
7 public Digit(byte value)
9 if (value < 0 || value > 9) throw new ArgumentException();
13 // define implicit Digit-to-byte conversion operator:
14 public static implicit operator byte(Digit d
)
16 Console
.WriteLine( "conversion occurred" );
23 public static void Main()
25 Digit d
= new Digit(3);
27 // implicit (no cast) conversion from Digit to byte