Instruction

  • This test contains a total of 11 questions.
  • Do not switch the tab or open a new window, otherwise, the test will be submitted automatically.
  • Test time is 10 minutes.

C# Intermediate (Level 2)

Q 1.
The default scope for the members of an interface is _____________.

Q 2.
Which of the following statements is incorrect about delegate?

Q 3.
The space required for structure variables is allocated on the stack.

Q 4.
Which of the following is incorrect about constructors?

Q 5.
Reference is a _____________.

Q 6.
If a class ‘demo’ had ‘add’ property with getting and set accessors, then which of the following statements will work correctly?

Q 7.
What will be the output of the following code snippet?
 using System; 
    class sample
    {
        int i;
        double k;
        public sample(int ii, double kk)
        {
            i = ii;
            k = kk;
            double j = (i) + (k);
            Console.WriteLine(j);
        }
        ~sample()
        {
            double j = i - k;
            Console.WriteLine(j);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            sample s = new sample(9, 2.5);
        }
    }

Q 8.
What will be the output of the following code snippet?
using System;
 class program
    {
        static void Main(string[] args)
        {
            int x = 8;
            int b = 16;
            int c = 64;
            x /= c /= b;
            Console.WriteLine(x + " " + b + " " + c);
            Console.ReadLine();
        }
    }

Q 9.
Struct’s data members are ___ by default.

Q 10.
What will be the output of the following code snippet?
using System;
 class sample
    {
        public sample()
        {
            Console.WriteLine("constructor 1 called");
        }
        public sample(int x)
        {
            int p = 2;
            int u;
            u = p + x;
            Console.WriteLine("constructor 2 called");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            sample s = new sample(4);
            sample t = new sample();
            Console.ReadLine();
        }
    }

Q 11.
Shared Assemblies can be stored in Global Assembly Cache.


Time: