Skip to content

Conversation

Enik3
Copy link

@Enik3 Enik3 commented Dec 16, 2019

No description provided.

}
else
{
throw new System.Exception();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в смысле? нельзя пол кроме male установить?

CourseApp/Dog.cs Outdated
this.age++;
}

public override string Vote()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Голосовать?

}
else
{
throw new System.Exception();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То же самое


set
{
if (value >= 1 && value < 10)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Если у вас оба животных с одинаковым ограничением по возрасту -> надо в базовый класс это выносить, а лучше просто привести с другим возрастом


public override string ToString()
{
return $"Имя:{Name},Возраст:{Age},Пол:{Sex}";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToString тоже явный кандидат, чтобы или его переопределить и возвращать строки по другому или же вернуть это все в базовый класс


public virtual string VirtualView()
{
return "Virtual Metod";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

CourseApp/Dog.cs Outdated
public Dog(string name, int age, string sex)
: base(name, age, sex)
{
Name = name;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔪

@jskonst jskonst merged commit ba7fb0b into ISUCT:Aleksandr_Enivatov Dec 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants