C# SortedSet Max
Description
SortedSet
gets the maximum value in the SortedSet
Syntax
SortedSet.Max
has the following syntax.
public T Max { get; }
Example
using System;/* w ww .j a v a2s.c o m*/
using System.Collections.Generic;
public class MainClass{
public static void Main(String[] argv){
SortedSet<int> evenNumbers = new SortedSet<int>();
for (int i = 0; i < 5; i++)
{
evenNumbers.Add(i * 2);
}
Console.WriteLine(evenNumbers.Max);
}
}
The code above generates the following result.