This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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