Skip to content

Instantly share code, notes, and snippets.

@lgolubyev
Created November 21, 2022 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgolubyev/9f9b220c2aeb8dc70891c84c03ef85ad to your computer and use it in GitHub Desktop.
Save lgolubyev/9f9b220c2aeb8dc70891c84c03ef85ad to your computer and use it in GitHub Desktop.
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