Monday, February 14, 2011

Which constructor runs first? Base or Child

public class A
{
public A()
{}
}


Public class B :A
{
public B()
{}
}


B b = new B();

What do you think? Will A constructor run before or B Constructor run?
It would be the base class constructor(A) that would be running before the child constructor(B). Not sure? Run the above code yourself and find out.

No comments:

Post a Comment

Retrieving Calendar of a Bookable Resource in Dynamics

There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...