Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Access Modifiers Practice | OOP Essentials
C# Beyond Basics
course content

Conteúdo do Curso

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:

  1. Making both Student and Teacher inherit from thePerson class;
  2. Ensure that the name field is accessible in the child classes but inaccessible from anywhere else.
cs

index

Tudo estava claro?

Seção 4. Capítulo 4
We're sorry to hear that something went wrong. What happened?
some-alt