Useful Methods to Return values in Arrays Here are the available methods to get values in an array. Max returns the largest value. Min returns the smallest value. Sum returns the sum of all elements. Examples : Let’s consider this array : int[ ] arr = { 2, 4, 7, 1}; Console.WriteLine(arr.Max()); //Outputs :  7 Console.WriteLine(arr.Min()); //Outputs : 1Console.WriteLine(arr.Sum()); //Outputs : 14Read More →

Many operators in C# can be overloaded, it means that they can be redefined for custom actions. For example, you can redefine the action of the plus (+) operator in a custom class. Consider the Box class that has Height and Width properties: class Box { public int Height {get; set;} public int Width {get; set;} public Box(int h, int w) { Height = h; Width = w; } } static void Main(string[] args) { Box b1 = new Box(14, 3); Box b2 = new Box(5, 7); } We would like to add these two Box objects, which would result in a new, bigger Box.Read More →