Sobes.tech
Back to tasks
Junior — Senior
94

Определить ошибки в реализации классов C#

Get help with live coding in real time with Sobes Copilot
Task condition

Какие проблемы присутствуют в приведённом коде? Сможет ли он успешно скомпилироваться? Если нет — объясните причины.

private sealed class Animal
    {
        private int Velocity = 150;

        void Run (int distance)
        {
            Velocity += distance;
        }
}

class Dog: Animal
    {
        Dog()
        {
            Velocity = 150;
        }

        void Run(int distance)
        {

        }
    }

public class Main
        {
            public Main()
        {
            var c = new Dog();
        }
}