C# protected property, setter and getter
This code is copied from the first page of lesson in Inheritance & Polymorphism > Protected Members in C# Intermediate. I admit I haven't finished module Inheritance & Polymorphism yet, but I'm curious how to change the property of a protected member. First thing comes to my mind is a setter and getter. However, the Name property is declared inside the parent class, it seems it is not logical to override the Name in Student child class. Then I added two functions to simulate the setter and getter behavior, which are the ChangeName and GetName method. Is it the correct way to update a protected property? By "correct" I mean is it the preferred way? As a side question, why "this" is not present in line 17? I found this work the same with or without it. However, without "this", how come the program able to distinguish object between s and s2? https://sololearn.com/compiler-playground/c01iiDl1XACR/?ref=app