Interesting OOPS puzzle

Posted by user3714387 on Stack Overflow See other posts from Stack Overflow or by user3714387
Published on 2014-06-06T09:08:12Z Indexed on 2014/06/06 9:25 UTC
Read the original article Hit count: 245

Filed under:
|

Recently, faced the below question from one of the interviewer. Initially thought that the question was wrong, but the interviewer mentioned there is solution for this. Quite interesting. Can anyone shed light please ? Program as below.

public class BaseHome
{
    public static void main()
    {
        Console.WriteLine("A");
    }
}

Required output :

B
A
C

Condition : Should not make any change in the Main function. Should not create any additional class.

Please advice if this can be done with the condition met.

© Stack Overflow or respective owner

Related posts about c#

Related posts about oop