Тема: Чому я не можу створити новий об"єкт в майн
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace aftoregFacebook
{
class People
{
public string Name { set; get; }
public string Famely { set; get; }
public string Email { set; get; }
public People (string name, string famely, string email)
{
Name = name;
Famely = famely;
Email = email;
}
public virtual void WM()
{
Console.WriteLine("pervaya 4ast'");
}
public class Men : People
{
public Men (string name, string famely, string email) : base (name, famely, email)
{
}
public override void WM()
{
base.WM();
Console.WriteLine("vtoraya 4ast' men");
}
}
public class Women : People
{
Random randPas = new Random();
public Women (string name, string famely, string email) : base (name, famely, email)
{
Console.WriteLine("Password: " + randPas.Next(1, 100));
}
public override void WM()
{
base.WM();
Console.WriteLine("vtoraya 4ast' women");
}
}
}
class Program
{
public static void Main(string[] args)
{
Console.ReadKey();
}
}
}