Какой функцией можно заменить все "this" - C#

Узнай цену своей работы

Формулировка задачи:

Подскажите, пожалуйста, какой функцией можно заменить все эти "this", чтобы не прописывать его для каждой переменной?
     public Sportsmen(string name, int age, int energy, int power, int gender, double height, double weight, string muscules)
        {
            this._name = name;
            this._age = age;
            this._energy = energy;
            this._power = power;
            this._gender = gender;
            this._height = height;
            this._weight = weight;
            this._muscles = muscules;

        }

Решение задачи: «Какой функцией можно заменить все "this"»

textual
Листинг программы
class Sportsmen
    {
        string name;
        int age;
        int energy;
        int power;
        int gender;
        double height;
        double weight;
        string muscles;
 
        public Sportsmen(string name, int age, int energy, int power, int gender, double height, double weight, string muscules)
        {
            this.name = name;
            this.age = age;
            this.energy = energy;
            this.power = power;
            this.gender = gender;
            this.height = height;
            this.weight = weight;
            this.muscles = muscules;

ИИ для рефератов и докладов


  • Экспорт Word по ГОСТу
  • Минимум 80% уникальности текста
  • Поиск релевантных источников в интернете
  • Готовый документ за 2 минуты

Оцени полезность:

10   голосов , оценка 3.6 из 5
Похожие ответы