Перенос страниц

This commit is contained in:
Alexander Zhirov 2023-03-05 15:30:34 +03:00
parent 4d57446057
commit 4c954c9186
129 changed files with 14 additions and 15 deletions

View file

@ -0,0 +1,39 @@
class Contact
{
string bgColor()
{
return "Серый";
}
}
class Friend : Contact
{
string currentBgColor = "Светло-зеленый";
string currentReminder;
this(ref string c)
{
currentBgColor = c;
}
override string bgColor()
{
return currentBgColor;
}
string reminder()
{
return currentReminder;
}
}
unittest
{
string startColor = "Синий";
Friend f = new Friend(startColor);
Contact c = f; // Подставить экземпляр класса Friend вместо экземпляра класса Contact
auto color = c.bgColor(); // Вызвать метод класса Friend
import std.stdio : writeln;
writeln(color);
}