Untitled
unknown
plain_text
2 years ago
674 B
6
Indexable
Console.WriteLine("Location: {0}", Location);
}
}
public class C : B
{
public int Age;
public void GetAge()
{
Console.WriteLine("Age: {0}", Age);
}
}
class Program
{
static void Main(string[] args)
{
C c = new C();
Console.WriteLine("Enter cricketer Details");
Console.WriteLine("Enter Cricketer Name:");
c.Name = Console.ReadLine();
Console.WriteLine("Enter Cricketer Location:");
c.Location = Console.ReadLine();
Console.WriteLine("Enter Cricketer Age:");
c.Age = int.Parse(Console.ReadLine());
c.GetName();
c.GetLocation();
c.GetAge();
Console.WriteLine("\nPress Any Key to Exit..");
Console.ReadLine();
}
}
}Editor is loading...
Leave a Comment