using System;
public class Program
{
public static void Main()
string strA = null;
string strB = "developer";
// If first string is null and you try to invoke .Equals() method on it, an exception of type NullReferenceException is thrown
Console.WriteLine(strA.Equals(strB)); // Throws Exception
// Comment above line to run the below code
// Instead, use static String.Equals method or == operator for comparing Strings because both are null-safe.
Console.WriteLine(String.Equals(strA, strB)); // No Exception
Console.WriteLine(strA==strB); // No Exception
}