Answer: We can call the methods inside the constructor. For eg:
public class AbstractTest
{
public abstract class AbstractClass
{
public abstract void Method1();
public string GetFullname(string lastname, string firstname)
{
return firstname + lastname;
}
}
public class DerivedClass : AbstractClass
{
public override void Method1()
{
throw new NotImplementedException();
}
public DerivedClass()
{
string fullname = GetFullname("Vijay", "Chakraborty");
//Do further implementation
}
}
Source: In an interview | Asked In: Many Interviews |
Alert Moderator