Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The using keyword must be before any declarations ad and definitions within a namespace

Within the csharp_app_struture namespace there are now two Person classes available. When you run this program it will print the value 33. The C# compiler resolves to the last seen definition. So the Person definition at line 14 overrides that seen in line 5.

Info

It’s normal practice to organise your namespaces into separate files or within the same file as shown in the example above