abdelwaheb ammar

abdelwaheb ammar

  • 1.2k
  • 393
  • 118.4k

protected property of parent class

Nov 30 2015 5:24 AM
Hello I use a parent class property called "Contribuable" and then I called in a derived class called "ContribuableMoral" during execution but it appears to me in the null derived class method.
 
public class contribuable
{
protected string MATRICULE_FISCALE;
public contribuable(string _matricule_fiscale)
{
this.MATRICULE_FISCALE = _matricule_fiscale; //example MATRICULE_FISCALE=123456789
}
public void insertContribuable()
{
string sql = "insert into CLIENT (MATRICULE_FISCALE)values('" +this.MATRICULE_FISCALE +"')"; //MATRICULE_FISCALE=123456789
}
}
class ContribuableMoral:contribuable
{
public ContribuableMoral()
{
}
public void InsertionMorale()
{
string sqlMorale = "insert into CLIENT_MORALE(MATRICULE_FISCALE) values('" + MATRICULE_FISCALE + "')"; //MATRICULE_FISCALE=null
}
}
 
 
normally ownership relatives told the class can be called to the derived class?!!!!!!!!!!! 
 
 

Answers (3)