File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
docs/csharp/programming-guide/classes-and-structs/snippets/properties Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 44using VersionSeven ;
55
66//<GetAccessor>
7- var employee = new Employee ( ) ;
7+ var employee = new Employee ( ) ;
88//...
99
10- System . Console . Write ( employee . Name ) ; // the get accessor is invoked here
10+ System . Console . Write ( employee . Name ) ; // the get accessor is invoked here
1111//</GetAccessor>
1212
1313//<SetAccessor>
1414var student = new Student ( ) ;
15- student . Name = "Joe" ; // the set accessor is invoked here
15+ student . Name = "Joe" ; // the set accessor is invoked here
1616
17- System . Console . Write ( student . Name ) ; // the get accessor is invoked here
17+ System . Console . Write ( student . Name ) ; // the get accessor is invoked here
1818//</SetAccessor>
1919
2020HidingExample . TestHiding . Test ( ) ;
2121
2222// <SnippetInitialize>
2323var aPerson = new Person ( "John" ) ;
24- aPerson = new Person { FirstName = "John" } ;
24+ aPerson = new Person { FirstName = "John" } ;
2525// Error CS9035: Required member `Person.FirstName` must be set:
2626//aPerson2 = new Person();
2727// </SnippetInitialize>
You can’t perform that action at this time.
0 commit comments