Pages

General Puzzle1

This is very simple code which every one might have faced but you didn't have noted this. Is that possible to create a static void main with int as return type like code shown below?


class Program
    {
        static int Main(string[] args)
        {
            return 0;
        }
    }
And is it possible to pass int args instead of string args like this?


class Program
    {
        static void Main(int[] args)
        {
        }
    }

Please dont Execute code.....

Oops Puzzle1

Object Oriented Programming seems to be tricky usually. This Puzzle is based on Inheritance.

Consider there are 2 Classes
Class A and Class B

class Program
    {
        
        static void Main(string[] args)
        {
            ClassA _objClassA = new ClassB();
            _objClassA.Function1(); 
        }
    }

public Class ClassA
{
    public void Function1()
    {
         Console.WriteLine("ClassA...Function1()");
    }
}
public class ClassB:ClassA
{
    public void Function1()
    {
         Console.WriteLine("ClassB...Function1()");
    }
}


What is the Result of the above Program.
Please do not execute this program. Try to solve by looking code.