using System;
// Base class (parent class)
public class Animal {
public string Name;
public void Eat() {
Console.WriteLine($"{Name} is eating.");
}
// Derived class (child class)
public class Dog : Animal {
public void Bark() {
Console.WriteLine($"{Name} is barking.");
class ConsoleApp {
static void Main() {
// Creating an instance of the derived class
Dog myDog = new Dog();
myDog.Name = "Buddy";
// Using inherited method from the base class
myDog.Eat();
// Using method specific to the derived class
myDog.Bark();