Question about call base class constructor

  • Thread starter Thread starter DreamTV
  • Start date Start date
D

DreamTV

BlankHi, I am C# newbie , I have a class that inherit another class and I want to
call constructor of base class
I use:
base(parameter)... like this
but it doesn't work .
Need some help.
Regards
TA
 
Hi,

You can use this:

public class BaseClass
{
public BaseClass(string parameter1)
{
}
}

public class DerivedClass : BaseClass
{
public DerivedClass(string parameter1) : base(parameter1)
{
}
}


Regards,
Paulo Gomes
 
BlankThanks u guys
Hi, I am C# newbie , I have a class that inherit another class and I want to
call constructor of base class
I use:
base(parameter)... like this
but it doesn't work .
Need some help.
Regards
TA
 
Back
Top