.Equals and == Demo

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

namespace RefValDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            int val1 = 5;
            int val2 = 5;
            Console.WriteLine(val1==val2);
            Console.WriteLine(val1.Equals(val2));
            object str1 = new string(new char[] { 's', 'h', 'i', 'p', 'r', 'a' });
            object str2 = new string(new char[] { 's', 'h', 'i', 'p', 'r', 'a' }); 
            Console.WriteLine(str1==str2);
            Console.WriteLine(str1.Equals(str2));

            StringBuilder sb1 = new StringBuilder();
            sb1.Append("hello");
            StringBuilder sb2 = new StringBuilder();
            sb2.Append("hello");
            Console.WriteLine(sb1==sb2);
            Console.WriteLine(sb1.Equals(sb2));

            Customer c1 = new Customer()
            { FirstName = "Croma", LastName = "Campus" };
            Customer c2 = new Customer()
            { FirstName = "Croma", LastName = "Campus" };
            Console.WriteLine(c1==c2);
            Console.WriteLine(c1.Equals(c2));
            //Console.WriteLine(c1.GetHashCode());
            //Console.WriteLine(c2.GetHashCode());
            Console.ReadLine();
        }
    }
    class Customer
    {
        object obj = new object();
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public override bool Equals(object obj)
        {
            Customer obj1 = obj as Customer;
            return this.FirstName.Equals(obj1.FirstName) 
                && this.LastName.Equals(obj1.LastName);
        }
        public override int GetHashCode()
        {
            return FirstName.GetHashCode() ^ LastName.GetHashCode();
        }
    }
}


Async Await Demo

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

namespace AsyncAwaitDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Method();
            Console.ReadLine();
        }

        private async static void Method()
        {
            await Task.Run(new Action(LongTask));
            Console.WriteLine("New thread..");

        }
        public static void LongTask()
        {
            Thread.Sleep(20000);
            Console.WriteLine("LongMethod completed.");
        }
    }
}

Threading Demo

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

namespace ThreadingDemo
{
    class Program
    {
        static public void HelloThreading()
        {
            Console.WriteLine("This is child thread started..");
            Thread.Sleep(5000);
        }
        static void Main(string[] args)
        {
            Console.WriteLine("This is main thread");
            ThreadStart th = new ThreadStart(HelloThreading);
            Thread childThread = new Thread(th);
            childThread.Start();
            Console.WriteLine("This is end of main thread");
            for (int i = 0; i < 10; i++)
            {
                Thread.Sleep(500);
                Console.WriteLine("Waiting for child thread to complete{0}..",i);
            }
            if(childThread.IsAlive)
            {
                try
                {
                    childThread.Abort();
                }
                catch (Exception)
                {
                    throw;
                }
                finally
                {
                    Console.WriteLine("Child thread aborted...");
                }
            }
            else
            {
                Console.WriteLine("Child thread completed...");
            }
            Console.ReadLine();
        }
    }
}