class Vehicle // base class (parent)
{
public string brand = "Ford"; // Vehicle field
public void honk() // Vehicle method
{
Console.WriteLine("Tuut, tuut!");
}
}
class Car : Vehicle // derived class (child)
{
public string modelName = "Mustang"; // Car field
brand = "WHY İS NOT ??? "; // Error.
public void honk(); // Error.
}
Can't I do that? Does the class we inherit have its functions, methods, and variables? Did I learn something wrong?
Note; It works within the main function.
I've been dealing with this for a long time. : / (3+ hours)