Check out example codes for "debe estar un objeto debajo de main() en c#". It will help you in understanding the concepts better.

Code Example 1

// Object initializer.
var instance3 = new ExampleClass { Name = "Desktop", ID = 37414,
    Location = "Redmond", Age = 2.3 };

// Default constructor and assignment statements.
var instance4 = new ExampleClass();
instance4.Name = "Desktop";
instance4.ID = 37414;
instance4.Location = "Redmond";
instance4.Age = 2.3;

Learn ReactJs, React Native from akashmittal.com