I have a API and it use a abstract class.
I not familiar with abstract class and I also researched about it.
So far this is my code:
[DataContract]
public abstract class Questions_Base
{
public void Import(Oasis OasisSource);
}
public class Questions : Questions_Base
{
public Questions()
{
//
// TODO: Add constructor logic here
//
}
public void Import(Oasis OasisSource) {
string B1String;
while ((B1String = OasisFile.ReadLine()) != null)
{
Questions oQuestions = new Questions();
Oasis oOasis = new Oasis();
oOasis.B1 = B1String;
oQuestions.Import(oOasis); //error here Object reference not set to an instance of an object.
}
}
}
Please Advice me.. thanks!
abstract classes are used to provide common functionality to child classes and force child to have own implementation of abstract members. it cannot be initialized, so individually it is not an object, but takes part in behaviour of child class