Question about inheritance

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

DreamTV

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
 
DreamTV said:
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

public abstract class BaseClass
{
protected BaseClass( string someParam )
{
...
}
}

public class ChildClass : BaseClas
{
public ChildClass( string someParam ) : base( someParam )
{
...
}
}

-Chad
 
Back
Top