Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 25524 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > How will you call non-abstract methods o ...

How will you call non-abstract methods of an abstract class in derived class?

Interview question and answer by: Rajarsn@Gmail.Com | Posted on: 5/16/2012 | Category: C# Interview questions | Views: 946 | | Points: 40
Ads
Ads


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 
Found interesting? Add this to:


 Responses

Posted by: Akiii | Posted on: 17 May 2012 11:57:00 PM | Points: 10 | Alert Moderator 

This is good....


Regards
Akiii

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Rajarsn@Gmail.Com

    Even more ... | Submit Interview Questions and win prizes!


    About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
    General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
    Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 4:08:26 AM