Зміст курсу
C# Beyond Basics
C# Beyond Basics
Access Modifiers Practice
You are given a class named Person
with a field to store the name
. Additionally, there are two classes named Student
and Teacher
which derive from Person
.
There are some errors in the program because of some incomplete code. Your task is to complete the code by:
- Making both
Student
andTeacher
inherit from thePerson
class; - Ensure that the
name
field is accessible in the child classes but inaccessible from anywhere else.
index
Все було зрозуміло?