what is base() in inheritance

N

nicol

hi ;
i have a problem with how i could use [ base( ) ]
and i wrote a program for it but it didn't work

using System;
namespace inheritance_1
{
class Program
{
static void Main(string[] args)
{
employee me = new employee("sara", "me", 1000);
}
}
}
class person
{
protected string first_name;
protected string last_name;
public person(string fn, string ln)
{
first_name = fn;
last_name = ln;
}
public void dissplay_full_name ()
{
Console.WriteLine("her first name :");
Console.WriteLine(first_name);
Console.WriteLine("her last name :");
Console.WriteLine(last_name);
}
}
class employee : person
{
public employee(string fn , string ln , int f):(fn , ln ) // here
has a error
{
{
}
 
A

Arne Vajhøj

class employee : person
{
public employee(string fn , string ln , int f):(fn , ln ) // here
has a error

public employee(string fn , string ln , int f): base(fn , ln )

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top