Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created Nov 21, 2022
Embed
What would you like to do?
sealed class Users
{
public string name = "Stefan Djokic";
public void GetName()
{
Console.WriteLine("Name: {0}", name);
}
}
//Derived Class
public class Details : users //Error
{
public int age = 27;
public void GetAge()
{
Console.WriteLine("Age: {0}", age);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment