Technical Questions

2012-01-18

Question1 >>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            ISample myInterface = new ClassA();
            Console.WriteLine(myInterface.GetName());
            Console.WriteLine(myInterface.GetAge());
            Console.ReadLine();
        }
    }

    interface ISample
    {
        string GetName();
    }

    class ClassA:ISample
    {


        public string GetName()
        {
            return "This is my name Asif";
        }

        public int GetAge()
        {
            return 28;
        }


    }
}





Will you get myInterface.GetAge()?


Question2 >> Is
TableA as A left join TableB as B on A.Field1=B.Field1 same as 
TableB as B left join TableA as A on B.Field1=A.Field1


Question 3

There are 2 tables Employee & EmployeeDetails. How can I get all the Employees which has no records found in EmployeeDetails?

Question 4
Does struct supports the concept of inheritance?
No

Question 5
What is value type & reference type

Question 6 (lock)
  • Can we use value type in lock statement? 
  • Is there any issue in using same variable for lock statement in areas in the class which are unrelated?
  • If an exception occurs inside lock statement block, will the lock get released or permanently locked?
Question 7 (OOPs)
  •  What are the some of the benefits of abstraction?
  • Which will be the first OOPs concept you will apply when you write a class?
  • Which OOPs concept gets applied first abstraction or encapsulation?

0 comments: