using System.Collections.Generic;
public static void Main()
var firstSet = new HashSet<string>( new string[] { "SQL", "Java", "C#", "PHP" });
var secondSet = new HashSet<string>( new string[] { "Oracle", "SQL", "MySQL" });
var union = new HashSet<string>(firstSet);
union.UnionWith(secondSet);
public static void PrintSet<T>(ISet<T> set)
foreach (var element in set)
Console.Write("{0} ", element);