What is the output of the following code?
using System; class MainClass { static int x; public static void Main(string[] args) { Console.WriteLine (x); } }
0
The code outputs 0, because fields are implicitly assigned a default value
Fields elements are automatically initialized with the default values for their type.