General Questions

Question 16 :

Which of the following statements is correct about constructors in C#.NET?


A). A constructor cannot be declared as private.
B). A constructor cannot be overloaded.
C). A constructor can be a static constructor.
D). A constructor cannot access static data.
E). this reference is never passed to a constructor.
Answer : Option C

Question 17 :

What will be the output of the C#.NET code snippet given below?

namespace IndiaparinamConsoleApplication
{
    class Sample
    { 
        public static void fun1()
        { 
            Console.WriteLine("parinam1 method");
        }
        public void fun2()
        { 
            fun1(); 
            Console.WriteLine("parinam2 method");
        }
        public void fun2(int i)
        { 
            Console.WriteLine(i);
            fun2(); 
        } 
    } 
    class MyProgram
    { 
        static void Main(string[ ] args)
        { 
            Sample s = new Sample(); 
            Sample.fun1(); 
            s.fun2(123);
        } 
    } 
}


A).
parinam1 method
123
parinaml method
parinam2 method
B).
parinam1 method
123
parinam2 method

C).
parinam2 method
123
parinam2 method
parinaml method
D).
parinaml method
123
E).
parinam2 method
123
parinaml method
Answer : Option A