fork download
  1. using System;
  2. class Test {
  3. struct S: IFormattable {
  4. public override string ToString() => "Object.ToString";
  5. public string ToString(string format, IFormatProvider formatProvider) => "IFormattable.ToString";
  6. }
  7. public static void Main()
  8. {
  9. S s = new S();
  10. Console.WriteLine($"{s}");
  11. Console.WriteLine($"{s.ToString()}");
  12. }
  13. }
  14.  
Success #stdin #stdout 0.02s 14568KB
stdin
Standard input is empty
stdout
IFormattable.ToString
Object.ToString