fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. var x = "hello";
  8. x = "world";
  9. x = 42; // compilation fails here... see the error message for details
  10. }
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(9,7): error CS0029: Cannot implicitly convert type `int' to `string'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty